From c01cdcb54a1555c026b8568df4f59694051b4398 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Tue, 18 Jan 2011 12:37:01 +0100 Subject: [PATCH] Fixed getChunkAt and usage. By: Erik Broes --- .../src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 2 +- .../main/java/org/bukkit/craftbukkit/block/CraftBlock.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 289300c49a..d3aebcceb8 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -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) { diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java index 1c7ba3c690..867a8812da 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java @@ -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); } /**