mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 07:20:24 +01:00
Fixed getChunkAt and usage.
By: Erik Broes <erikbroes@grum.nl>
This commit is contained in:
parent
6e823e9992
commit
c01cdcb54a
2 changed files with 3 additions and 3 deletions
|
@ -64,7 +64,7 @@ public class CraftWorld implements World {
|
|||
}
|
||||
|
||||
public Chunk getChunkAt(Block block) {
|
||||
return getChunkAt(block.getX() << 4, block.getZ() << 4);
|
||||
return getChunkAt(block.getX() >> 4, block.getZ() >> 4);
|
||||
}
|
||||
|
||||
public boolean isChunkLoaded(Chunk chunk) {
|
||||
|
|
|
@ -30,7 +30,7 @@ public class CraftBlock implements Block {
|
|||
this.type = type;
|
||||
this.data = data;
|
||||
this.light = (byte)world.getHandle().j(x, y, z);
|
||||
this.chunk = (CraftChunk)world.getChunkAt(x << 4, z << 4);
|
||||
this.chunk = (CraftChunk)world.getChunkAt(x >> 4, z >> 4);
|
||||
}
|
||||
|
||||
protected CraftBlock(final CraftWorld world, final int x, final int y,
|
||||
|
@ -42,7 +42,7 @@ public class CraftBlock implements Block {
|
|||
this.type = type;
|
||||
this.data = data;
|
||||
this.light = light;
|
||||
this.chunk = (CraftChunk)world.getChunkAt(x << 4, z << 4);
|
||||
this.chunk = (CraftChunk)world.getChunkAt(x >> 4, z >> 4);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue