mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-24 17:22:55 +01:00
SPIGOT-5556: Some biome methods use incorrect positions
See SPIGOT-5529 By: md_5 <git@md-5.net>
This commit is contained in:
parent
70e7ee9775
commit
c03616905c
2 changed files with 6 additions and 6 deletions
|
@ -126,7 +126,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");
|
||||||
CraftChunk.validateChunkCoordinates(x, y, z);
|
CraftChunk.validateChunkCoordinates(x, y, z);
|
||||||
|
|
||||||
return CraftBlock.biomeBaseToBiome(biome.getBiome(x, y, z));
|
return CraftBlock.biomeBaseToBiome(biome.getBiome(x >> 2, y >> 2, z >> 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -139,7 +139,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");
|
||||||
CraftChunk.validateChunkCoordinates(x, y, z);
|
CraftChunk.validateChunkCoordinates(x, y, z);
|
||||||
|
|
||||||
return biome.getBiome(x, y, z).getAdjustedTemperature(new BlockPosition((this.x << 4) | x, y, (this.z << 4) | z));
|
return biome.getBiome(x >> 2, y >> 2, z >> 2).getAdjustedTemperature(new BlockPosition((this.x << 4) | x, y, (this.z << 4) | z));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -901,7 +901,7 @@ public class CraftWorld implements World {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Biome getBiome(int x, int y, int z) {
|
public Biome getBiome(int x, int y, int z) {
|
||||||
return CraftBlock.biomeBaseToBiome(this.world.getBiome(new BlockPosition(x, y, z)));
|
return CraftBlock.biomeBaseToBiome(this.world.getBiome(x >> 2, y >> 2, z >> 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -919,7 +919,7 @@ public class CraftWorld implements World {
|
||||||
net.minecraft.server.Chunk chunk = this.world.getChunkAtWorldCoords(pos);
|
net.minecraft.server.Chunk chunk = this.world.getChunkAtWorldCoords(pos);
|
||||||
|
|
||||||
if (chunk != null) {
|
if (chunk != null) {
|
||||||
chunk.getBiomeIndex().setBiome(x, y, z, bb);
|
chunk.getBiomeIndex().setBiome(x >> 2, y >> 2, z >> 2, bb);
|
||||||
|
|
||||||
chunk.markDirty(); // SPIGOT-2890
|
chunk.markDirty(); // SPIGOT-2890
|
||||||
}
|
}
|
||||||
|
@ -934,7 +934,7 @@ public class CraftWorld implements World {
|
||||||
@Override
|
@Override
|
||||||
public double getTemperature(int x, int y, int z) {
|
public double getTemperature(int x, int y, int z) {
|
||||||
BlockPosition pos = new BlockPosition(x, y, z);
|
BlockPosition pos = new BlockPosition(x, y, z);
|
||||||
return this.world.getBiome(pos).getAdjustedTemperature(pos);
|
return this.world.getBiome(x >> 2, y >> 2, z >> 2).getAdjustedTemperature(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -944,7 +944,7 @@ public class CraftWorld implements World {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public double getHumidity(int x, int y, int z) {
|
public double getHumidity(int x, int y, int z) {
|
||||||
return this.world.getBiome(new BlockPosition(x, y, z)).getHumidity();
|
return this.world.getBiome(x >> 2, y >> 2, z >> 2).getHumidity();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Add table
Reference in a new issue