mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-10 18:44:05 +09:00
fixed a bug where a dynamic item would not get saved/loaded at all
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package net.torvald.terrarum.modulebasegame.console
|
||||
|
||||
import net.torvald.terrarum.*
|
||||
import net.torvald.terrarum.console.ConsoleCommand
|
||||
import net.torvald.terrarum.console.Echo
|
||||
import net.torvald.terrarum.serialise.Common
|
||||
|
||||
/**
|
||||
* Created by minjaesong on 2022-02-22.
|
||||
*/
|
||||
object DynToStatic : ConsoleCommand {
|
||||
override fun execute(args: Array<String>) {
|
||||
ItemCodex.dynamicToStaticTable.forEach { (d,s) ->
|
||||
Echo("$ccG$d$ccW → $ccY$s")
|
||||
}
|
||||
}
|
||||
|
||||
override fun printUsage() {
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,7 @@ import net.torvald.terrarum.console.Echo
|
||||
import net.torvald.terrarum.modulebasegame.TerrarumIngame
|
||||
import net.torvald.terrarum.serialise.ReadActor
|
||||
import net.torvald.terrarum.serialise.ReadWorld
|
||||
import java.io.File
|
||||
import java.io.IOException
|
||||
|
||||
/**
|
||||
@@ -16,8 +17,9 @@ object ImportWorld : ConsoleCommand {
|
||||
override fun execute(args: Array<String>) {
|
||||
if (args.size == 2) {
|
||||
try {
|
||||
val reader = java.io.FileReader(App.defaultDir + "/Exports/${args[1]}.json")
|
||||
ReadWorld.readWorldAndSetNewWorld(Terrarum.ingame!! as TerrarumIngame, reader)
|
||||
val file = File(App.defaultDir + "/Exports/${args[1]}.json")
|
||||
val reader = java.io.FileReader(file)
|
||||
ReadWorld.readWorldAndSetNewWorld(Terrarum.ingame!! as TerrarumIngame, reader, file)
|
||||
Echo("Importworld: imported a world from ${args[1]}.json")
|
||||
}
|
||||
catch (e: IOException) {
|
||||
|
||||
Reference in New Issue
Block a user