SPIGOT-6816: Fix ChunkSnapshot#getBiome
This commit is contained in:
parent
c86a3f7a58
commit
45c3f82669
@ -132,8 +132,8 @@ public class CraftChunkSnapshot implements ChunkSnapshot {
|
|||||||
Preconditions.checkState(biome != null, "ChunkSnapshot created without biome. Please call getSnapshot with includeBiome=true");
|
Preconditions.checkState(biome != null, "ChunkSnapshot created without biome. Please call getSnapshot with includeBiome=true");
|
||||||
validateChunkCoordinates(x, y, z);
|
validateChunkCoordinates(x, y, z);
|
||||||
|
|
||||||
DataPaletteBlock<BiomeBase> biome = this.biome[getSectionIndex(y)];
|
DataPaletteBlock<BiomeBase> biome = this.biome[getSectionIndex(y >> 2)];
|
||||||
return CraftBlock.biomeBaseToBiome((IRegistry<BiomeBase>) biome.registry, biome.get(x >> 2, y >> 2, z >> 2));
|
return CraftBlock.biomeBaseToBiome((IRegistry<BiomeBase>) biome.registry, biome.get(x >> 2, (y & 0xF) >> 2, z >> 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -146,8 +146,8 @@ public class CraftChunkSnapshot implements ChunkSnapshot {
|
|||||||
Preconditions.checkState(biome != null, "ChunkSnapshot created without biome. Please call getSnapshot with includeBiome=true");
|
Preconditions.checkState(biome != null, "ChunkSnapshot created without biome. Please call getSnapshot with includeBiome=true");
|
||||||
validateChunkCoordinates(x, y, z);
|
validateChunkCoordinates(x, y, z);
|
||||||
|
|
||||||
DataPaletteBlock<BiomeBase> biome = this.biome[getSectionIndex(y)];
|
DataPaletteBlock<BiomeBase> biome = this.biome[getSectionIndex(y >> 2)];
|
||||||
return biome.get(x >> 2, y >> 2, z >> 2).getTemperature(new BlockPosition((this.x << 4) | x, y, (this.z << 4) | z));
|
return biome.get(x >> 2, (y & 0xF) >> 2, z >> 2).getTemperature(new BlockPosition((this.x << 4) | x, y, (this.z << 4) | z));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
x
Reference in New Issue
Block a user