mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-08 03:22:19 +01:00
SPIGOT-7188: ChunkSnapshot biome y coordinate doesn't match chunk biome y coord
By: DerFrZocker <derrieple@gmail.com>
This commit is contained in:
parent
26ae05b48f
commit
609f8055d2
1 changed files with 2 additions and 2 deletions
|
@ -150,7 +150,7 @@ 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);
|
||||||
|
|
||||||
PalettedContainerRO<Holder<BiomeBase>> biome = this.biome[getSectionIndex(y >> 2)];
|
PalettedContainerRO<Holder<BiomeBase>> 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));
|
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");
|
Preconditions.checkState(biome != null, "ChunkSnapshot created without biome. Please call getSnapshot with includeBiome=true");
|
||||||
validateChunkCoordinates(x, y, z);
|
validateChunkCoordinates(x, y, z);
|
||||||
|
|
||||||
PalettedContainerRO<Holder<BiomeBase>> biome = this.biome[getSectionIndex(y >> 2)];
|
PalettedContainerRO<Holder<BiomeBase>> 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));
|
return biome.get(x >> 2, (y & 0xF) >> 2, z >> 2).value().getTemperature(new BlockPosition((this.x << 4) | x, y, (this.z << 4) | z));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue