3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 20:40:08 +01:00

Fixed getChunkAt and usage.

Dieser Commit ist enthalten in:
Erik Broes 2011-01-18 12:37:01 +01:00
Ursprung 3143e503fe
Commit 90c52739c4
2 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -64,7 +64,7 @@ public class CraftWorld implements World {
} }
public Chunk getChunkAt(Block block) { 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) { public boolean isChunkLoaded(Chunk chunk) {

Datei anzeigen

@ -30,7 +30,7 @@ public class CraftBlock implements Block {
this.type = type; this.type = type;
this.data = data; this.data = data;
this.light = (byte)world.getHandle().j(x, y, z); 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, protected CraftBlock(final CraftWorld world, final int x, final int y,
@ -42,7 +42,7 @@ public class CraftBlock implements Block {
this.type = type; this.type = type;
this.data = data; this.data = data;
this.light = light; this.light = light;
this.chunk = (CraftChunk)world.getChunkAt(x << 4, z << 4); this.chunk = (CraftChunk)world.getChunkAt(x >> 4, z >> 4);
} }
/** /**