From 02abf41b83df3f030253635a2c87f26dcec11866 Mon Sep 17 00:00:00 2001 From: Albert Pham Date: Sat, 23 Feb 2013 22:19:51 -0800 Subject: [PATCH] Fixed AddBlocks (again) and simplified expression. Herpy derpy, >> 2 is not divide by 2, and I am not sure what I was thinking with the double shift. --- src/main/java/com/sk89q/worldedit/data/AnvilChunk.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/data/AnvilChunk.java b/src/main/java/com/sk89q/worldedit/data/AnvilChunk.java index 96f92559a..5dc387a5f 100644 --- a/src/main/java/com/sk89q/worldedit/data/AnvilChunk.java +++ b/src/main/java/com/sk89q/worldedit/data/AnvilChunk.java @@ -119,9 +119,9 @@ public class AnvilChunk implements Chunk { // 4 bits, so we have to divide by 2 and get the right 4 bits if (index % 2 == 0) { - addId = (blocksAdd[section][index >> 2] >> 4) << 8; + addId = (blocksAdd[section][index / 2] & 0xF0) << 4; } else { - addId = (blocksAdd[section][index >> 2] & 0xF) << 8; + addId = (blocksAdd[section][index / 2] & 0x0F) << 8; } return blocks[section][index] & 0xFF + addId;