From e142fb9fd3784080c43e025c32d8306881fee4ca Mon Sep 17 00:00:00 2001 From: DerFrZocker Date: Wed, 29 Mar 2023 19:33:34 +0200 Subject: [PATCH] SPIGOT-7188: ChunkSnapshot biome y coordinate doesn't match chunk biome y coord --- src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java b/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java index fdd31a962..69bb8b432 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java @@ -150,7 +150,7 @@ public class CraftChunkSnapshot implements ChunkSnapshot { Preconditions.checkState(biome != null, "ChunkSnapshot created without biome. Please call getSnapshot with includeBiome=true"); validateChunkCoordinates(x, y, z); - PalettedContainerRO> biome = this.biome[getSectionIndex(y >> 2)]; + PalettedContainerRO> biome = this.biome[getSectionIndex(y)]; // SPIGOT-7188: Don't need to convert y to biome coordinate scale since it is bound to the block chunk section return CraftBlock.biomeBaseToBiome(biomeRegistry, biome.get(x >> 2, (y & 0xF) >> 2, z >> 2)); } @@ -164,7 +164,7 @@ public class CraftChunkSnapshot implements ChunkSnapshot { Preconditions.checkState(biome != null, "ChunkSnapshot created without biome. Please call getSnapshot with includeBiome=true"); validateChunkCoordinates(x, y, z); - PalettedContainerRO> biome = this.biome[getSectionIndex(y >> 2)]; + PalettedContainerRO> biome = this.biome[getSectionIndex(y)]; // SPIGOT-7188: Don't need to convert y to biome coordinate scale since it is bound to the block chunk section return biome.get(x >> 2, (y & 0xF) >> 2, z >> 2).value().getTemperature(new BlockPosition((this.x << 4) | x, y, (this.z << 4) | z)); }