From 609f8055d2c023de40d81a7a6161f2c740b3d1b7 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Wed, 29 Mar 2023 19:33:34 +0200 Subject: [PATCH] SPIGOT-7188: ChunkSnapshot biome y coordinate doesn't match chunk biome y coord By: DerFrZocker --- .../main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java index fdd31a9627..69bb8b432c 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java +++ b/paper-server/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)); }