From f734d4eaf6428ee0de22dd5ee2675cae77d204b8 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Mon, 29 Nov 2021 08:52:41 +1100 Subject: [PATCH] SPIGOT-6816: Fix ChunkSnapshot#getBiome By: md_5 --- .../java/org/bukkit/craftbukkit/CraftChunkSnapshot.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 3ca8103277..5dc6517b52 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftChunkSnapshot.java @@ -132,8 +132,8 @@ public class CraftChunkSnapshot implements ChunkSnapshot { Preconditions.checkState(biome != null, "ChunkSnapshot created without biome. Please call getSnapshot with includeBiome=true"); validateChunkCoordinates(x, y, z); - DataPaletteBlock biome = this.biome[getSectionIndex(y)]; - return CraftBlock.biomeBaseToBiome((IRegistry) biome.registry, biome.get(x >> 2, y >> 2, z >> 2)); + DataPaletteBlock biome = this.biome[getSectionIndex(y >> 2)]; + return CraftBlock.biomeBaseToBiome((IRegistry) biome.registry, biome.get(x >> 2, (y & 0xF) >> 2, z >> 2)); } @Override @@ -146,8 +146,8 @@ public class CraftChunkSnapshot implements ChunkSnapshot { Preconditions.checkState(biome != null, "ChunkSnapshot created without biome. Please call getSnapshot with includeBiome=true"); validateChunkCoordinates(x, y, z); - DataPaletteBlock biome = this.biome[getSectionIndex(y)]; - return biome.get(x >> 2, y >> 2, z >> 2).getTemperature(new BlockPosition((this.x << 4) | x, y, (this.z << 4) | z)); + DataPaletteBlock biome = this.biome[getSectionIndex(y >> 2)]; + return biome.get(x >> 2, (y & 0xF) >> 2, z >> 2).getTemperature(new BlockPosition((this.x << 4) | x, y, (this.z << 4) | z)); } @Override