From 2411adb6d143ea56a79e4084a199782511e8410b Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Tue, 1 Aug 2017 21:36:01 -0500 Subject: [PATCH] Finish fixing AddBlock support --- .../fawe/object/clipboard/DiskOptimizedClipboard.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/com/boydti/fawe/object/clipboard/DiskOptimizedClipboard.java b/core/src/main/java/com/boydti/fawe/object/clipboard/DiskOptimizedClipboard.java index 47a6a995..e4fbdfb8 100644 --- a/core/src/main/java/com/boydti/fawe/object/clipboard/DiskOptimizedClipboard.java +++ b/core/src/main/java/com/boydti/fawe/object/clipboard/DiskOptimizedClipboard.java @@ -521,9 +521,8 @@ public class DiskOptimizedClipboard extends FaweClipboard implements Closeable { int index = (HEADER_SIZE) + (i << 1); // 00000000 00000000 // [ id ]data - byte id2 = mbb.get(index + 1); - mbb.put(index, (byte) (id >> 4)); - mbb.put(index + 1, (byte) (((id & 0xFF) << 4) + (id2 & 0xFF))); + char combined = mbb.getChar(index); + mbb.putChar(index, (char) ((combined & 0xF00F) + (id << 4))); } public void setCombined(int i, int combined) { @@ -536,7 +535,7 @@ public class DiskOptimizedClipboard extends FaweClipboard implements Closeable { // 00000000 00000000 // [ id ]data char combined = mbb.getChar(index); - mbb.putChar(index, (char) ((combined & 0xFFFF) + (add << 12))); + mbb.putChar(index, (char) ((combined & 0x0FFF) + (add << 12))); } @Override