different randomising for different layers

This commit is contained in:
minjaesong
2023-11-04 21:49:27 +09:00
parent 79ffaf6294
commit 4bea5e9bf9
2 changed files with 3 additions and 3 deletions

View File

@@ -307,7 +307,7 @@ internal object BlocksDrawer {
}
private fun getHashCoord(x: Int, y: Int, mod: Int) = (XXHash64.hash(LandUtil.getBlockAddr(world, x, y).toBig64(), mod.toLong()) fmod mod.toLong()).toInt()
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()
/**
* Autotiling; writes to buffer. Actual draw code must be called after this operation.
@@ -355,7 +355,7 @@ internal object BlocksDrawer {
}
var hash = if ((mode == WALL || mode == TERRAIN) && !BlockCodex[world.tileNumberToNameMap[thisTile.toLong()]].hasTag("NORANDTILE"))
getHashCoord(x, y, 8)
getHashCoord(x, y, 8, mode)
else 0
// draw a tile