fluids to their own block layer

This commit is contained in:
minjaesong
2023-10-10 05:33:40 +09:00
parent caffdbf861
commit 26936fde09
12 changed files with 199 additions and 54 deletions

View File

@@ -5,6 +5,7 @@ import net.torvald.terrarum.*
import net.torvald.terrarum.App.printdbg
import net.torvald.terrarum.console.Echo
import net.torvald.terrarum.gameworld.BlockLayerI16
import net.torvald.terrarum.gameworld.BlockLayerI16F16
import net.torvald.terrarum.gameworld.BlockLayerI16I8
import net.torvald.terrarum.gameworld.GameWorld
import net.torvald.terrarum.langpack.Lang
@@ -147,6 +148,7 @@ object LoadSavegame {
world.layerTerrain = BlockLayerI16(world.width, world.height)
world.layerWall = BlockLayerI16(world.width, world.height)
world.layerOres = BlockLayerI16I8(world.width, world.height)
world.layerFluids = BlockLayerI16F16(world.width, world.height)
newIngame.world = world // must be set before the loadscreen, otherwise the loadscreen will try to read from the NullWorld which is already destroyed
newIngame.worldDisk = VDUtil.readDiskArchive(worldDisk.diskFile, Level.INFO)

View File

@@ -84,6 +84,12 @@ class Terragen(world: GameWorld, seed: Long, params: Any) : Gen(world, seed, par
world.setTileTerrain(x, y, terrBlock, true)
world.setTileWall(x, y, wallBlock, true)
// TODO TEST CODE
if (terrBlock == Block.DIRT) {
world.setTileOre(x, y, "ores@basegame:1", 0)
}
}
// dither shits
@@ -111,12 +117,6 @@ class Terragen(world: GameWorld, seed: Long, params: Any) : Gen(world, seed, par
world.setTileTerrain(x, y, newTile, true)
world.setTileWall(x, y, newTile, true)
// TODO TEST CODE
if (newTile == Block.DIRT) {
world.setTileOre(x, y, "ores@basegame:1", 0)
}
}
/*