From 7b38d847c96e9159639aebc44d2856b337372e43 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Sat, 5 Aug 2017 18:50:40 -0500 Subject: [PATCH] Fix AddBlock stream to write bytes on odd vs even offsets (off-by-one) --- .../sk89q/worldedit/extent/clipboard/io/SchematicWriter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicWriter.java b/core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicWriter.java index 2785ffc9..6347e00b 100644 --- a/core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicWriter.java +++ b/core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SchematicWriter.java @@ -222,7 +222,7 @@ public class SchematicWriter implements ClipboardWriter { clipboard.IMP.streamIds(new NBTStreamer.ByteReader() { @Override public void run(int index, int byteValue) { - if (write[0] ^= true) { + if (write[0]) { try { rawStream.write(((byteValue >> 8) << 4) + (lastAdd[0])); } catch (IOException e) { @@ -231,6 +231,7 @@ public class SchematicWriter implements ClipboardWriter { } else { lastAdd[0] = byteValue >> 8; } + write[0] ^= true; } }); if (write[0]) {