paletted biome: fix biome receiving (wrong y)

This commit is contained in:
Bixilon 2022-09-13 22:54:26 +02:00
parent 3aca9f4adb
commit 2c65d96512
No known key found for this signature in database
GPG Key ID: 5CAD791931B09AC4

View File

@ -14,6 +14,7 @@
package de.bixilon.minosoft.data.world.biome.source
import de.bixilon.minosoft.data.registries.biomes.Biome
import de.bixilon.minosoft.gui.rendering.util.VecUtil.inSectionHeight
import de.bixilon.minosoft.gui.rendering.util.VecUtil.sectionHeight
class PalettedBiomeArray(
@ -24,6 +25,6 @@ class PalettedBiomeArray(
private val mask = (1 shl edgeBits) - 1
override fun getBiome(x: Int, y: Int, z: Int): Biome? {
return containers.getOrNull(y.sectionHeight - lowestSection)?.get(((((y.sectionHeight and mask) shl edgeBits) or (z and mask)) shl edgeBits) or (x and mask))
return containers.getOrNull(y.sectionHeight - lowestSection)?.get(((((y.inSectionHeight and mask) shl edgeBits) or (z and mask)) shl edgeBits) or (x and mask))
}
}