mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-15 16:16:10 +09:00
fix: tile randomiser breaks on world seam again
This commit is contained in:
@@ -34,7 +34,10 @@ class OregenAutotiling(world: GameWorld, seed: Long, val tilingModes: HashMap<It
|
|||||||
Worldgen.threadExecutor.join()
|
Worldgen.threadExecutor.join()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun getHashCoord(x: Int, y: Int, mod: Int) = (XXHash64.hash(LandUtil.getBlockAddr(world, x, y).toBig64(), ((x*16777619) xor (y+1073)).toLong()) fmod mod.toLong()).toInt()
|
private fun getHashCoord(x: Int, y: Int, mod: Int): Int {
|
||||||
|
val (x, y) = world.coerceXY(x, y)
|
||||||
|
return (XXHash64.hash(LandUtil.getBlockAddr(world, x, y).toBig64(), ((x*16777619) xor (y+1073)).toLong()) fmod mod.toLong()).toInt()
|
||||||
|
}
|
||||||
|
|
||||||
private fun draw(x: Int) {
|
private fun draw(x: Int) {
|
||||||
for (y in 0 until world.height) {
|
for (y in 0 until world.height) {
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package net.torvald.terrarum.modulebasegame.worldgenerator
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by minjaesong on 2023-11-10.
|
||||||
|
*/class Treegen {
|
||||||
|
}
|
||||||
@@ -307,7 +307,10 @@ internal object BlocksDrawer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private fun getHashCoord(x: Int, y: Int, mod: Int, layer: Int) = (XXHash64.hash(LandUtil.getBlockAddr(world, x, y).toBig64(), ((x*16777619) xor (y+1+layer)).toLong()) fmod mod.toLong()).toInt()
|
private fun getHashCoord(x: Int, y: Int, mod: Int, layer: Int): Int {
|
||||||
|
val (x, y) = world.coerceXY(x, y)
|
||||||
|
return (XXHash64.hash(LandUtil.getBlockAddr(world, x, y).toBig64(), ((x*16777619) xor (y+1+layer)).toLong()) fmod mod.toLong()).toInt()
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Autotiling; writes to buffer. Actual draw code must be called after this operation.
|
* Autotiling; writes to buffer. Actual draw code must be called after this operation.
|
||||||
|
|||||||
Reference in New Issue
Block a user