From c711827e94f35881ee2ad877f55b62f326085460 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Thu, 2 Aug 2012 11:21:40 -0500 Subject: [PATCH] Fix mapping of ChunkSection nibble data to snapshot. Fixes BUKKIT-1977 --- src/main/java/org/bukkit/craftbukkit/CraftChunk.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java index 4f9ac887ff..314c7323a0 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftChunk.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftChunk.java @@ -183,8 +183,8 @@ public class CraftChunk implements Chunk { continue; } - blockids[j<<1] |= (b & 0xF0) << 4; - blockids[(j<<1)+1] |= (b & 0x0F) << 8; + blockids[j<<1] |= (b & 0x0F) << 8; + blockids[(j<<1)+1] |= (b & 0xF0) << 4; } } @@ -192,11 +192,11 @@ public class CraftChunk implements Chunk { /* Get block data nibbles */ sectionBlockData[i] = new byte[2048]; - System.arraycopy(cs[i].i().a, 0, sectionBlockData[i], 0, 2048); + System.arraycopy(cs[i].j().a, 0, sectionBlockData[i], 0, 2048); // Should be getData sectionSkyLights[i] = new byte[2048]; - System.arraycopy(cs[i].k().a, 0, sectionSkyLights[i], 0, 2048); + System.arraycopy(cs[i].l().a, 0, sectionSkyLights[i], 0, 2048); // Should be getSkyLight sectionEmitLights[i] = new byte[2048]; - System.arraycopy(cs[i].j().a, 0, sectionEmitLights[i], 0, 2048); + System.arraycopy(cs[i].k().a, 0, sectionEmitLights[i], 0, 2048); // Should be getBlockLight } }