mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-07 20:31:51 +09:00
spawn clay wip
This commit is contained in:
@@ -18,6 +18,7 @@ object Block {
|
||||
const val DIRT = "basegame:32"
|
||||
const val GRASS = "basegame:33"
|
||||
const val GRASSWALL = "basegame:34"
|
||||
const val CLAY = "basegame:35"
|
||||
|
||||
const val PLANK_NORMAL = "basegame:48"
|
||||
const val PLANK_EBONY = "basegame:49"
|
||||
|
||||
@@ -115,6 +115,7 @@ class Biomegen(world: GameWorld, seed: Long, params: Any, val biomeMapOut: HashM
|
||||
private fun draw(x: Int, y: Int, noiseValue: List<Double>, world: GameWorld) {
|
||||
val control1 = noiseValue[0].coerceIn(0.0, 0.99999).times(slices).toInt().coerceAtMost(slices - 1)
|
||||
val control2 = noiseValue[1].coerceIn(0.0, 0.99999).times(9).toInt().coerceAtMost(9 - 1)
|
||||
val control3 = noiseValue[2].coerceIn(0.0, 0.99999).times(12).toInt().coerceAtMost(12 - 1)
|
||||
val ba = LandUtil.getBlockAddr(world, x, y)
|
||||
|
||||
if (y > 0) {
|
||||
@@ -189,11 +190,22 @@ class Biomegen(world: GameWorld, seed: Long, params: Any, val biomeMapOut: HashM
|
||||
}
|
||||
else -> null to null
|
||||
}
|
||||
val lutum = when (control3) {
|
||||
0 -> {
|
||||
if (tileThis == Block.DIRT) {
|
||||
Block.CLAY to Block.CLAY
|
||||
}
|
||||
else null to null
|
||||
}
|
||||
else -> null to null
|
||||
}
|
||||
|
||||
val outTile = if (grassRock.first == Block.STONE)
|
||||
grassRock
|
||||
else if (sablum.first != null)
|
||||
sablum
|
||||
else if (lutum.first != null)
|
||||
lutum
|
||||
else grassRock
|
||||
|
||||
|
||||
@@ -208,6 +220,7 @@ class Biomegen(world: GameWorld, seed: Long, params: Any, val biomeMapOut: HashM
|
||||
return listOf(
|
||||
makeRandomSpotties("TERRA", params.featureSize1),
|
||||
makeRandomSpotties("SABLUM", params.featureSize2),
|
||||
makeRandomSpotties("LUTUM", params.featureSize2),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,6 @@ object Worldgen {
|
||||
Work(Lang["MENU_IO_WORLDGEN_RETICULATING_SPLINES"], Terragen(world, highlandLowlandSelectCache, params.seed, params.terragenParams), listOf("TERRAIN")),
|
||||
Work(Lang["MENU_IO_WORLDGEN_GROWING_MINERALS"], Oregen(world, caveAttenuateBiasScaledCache, params.seed, oreRegistry), listOf("ORES")),
|
||||
Work(Lang["MENU_IO_WORLDGEN_POSITIONING_ROCKS"], OregenAutotiling(world, params.seed, oreTilingModes), listOf("ORES")),
|
||||
Work(Lang["MENU_IO_WORLDGEN_POSITIONING_ROCKS"], OregenAutotiling(world, params.seed, oreTilingModes), listOf("ORES")),
|
||||
// TODO generate rock veins
|
||||
// TODO generate gemstones
|
||||
Work(Lang["MENU_IO_WORLDGEN_CARVING_EARTH"], Cavegen(world, highlandLowlandSelectCache, params.seed, params.terragenParams), listOf("TERRAIN", "CAVE")),
|
||||
|
||||
Reference in New Issue
Block a user