From 2c65d96512107bc3d0f81fba64f5e18ea2ea52ed Mon Sep 17 00:00:00 2001 From: Bixilon Date: Tue, 13 Sep 2022 22:54:26 +0200 Subject: [PATCH] paletted biome: fix biome receiving (wrong y) --- .../minosoft/data/world/biome/source/PalettedBiomeArray.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/bixilon/minosoft/data/world/biome/source/PalettedBiomeArray.kt b/src/main/java/de/bixilon/minosoft/data/world/biome/source/PalettedBiomeArray.kt index 3f4fcc075..ac6fd3d6f 100644 --- a/src/main/java/de/bixilon/minosoft/data/world/biome/source/PalettedBiomeArray.kt +++ b/src/main/java/de/bixilon/minosoft/data/world/biome/source/PalettedBiomeArray.kt @@ -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)) } }