diff --git a/core/src/main/java/com/boydti/fawe/object/HistoryExtent.java b/core/src/main/java/com/boydti/fawe/object/HistoryExtent.java index a0dbf462..922eea8b 100644 --- a/core/src/main/java/com/boydti/fawe/object/HistoryExtent.java +++ b/core/src/main/java/com/boydti/fawe/object/HistoryExtent.java @@ -72,7 +72,7 @@ public class HistoryExtent extends AbstractDelegateExtent { } try { if (!FaweCache.hasNBT(id)) { - if (FaweCache.hasNBT(block.getId())) { + if (block.canStoreNBTData()) { this.changeSet.add(x, y, z, combined, block); } else { this.changeSet.add(x, y, z, combined, (block.getId() << 4) + block.getData()); 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 14ea8537..de1cb699 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 @@ -233,31 +233,6 @@ public class DiskOptimizedClipboard extends FaweClipboard implements Closeable { public static long start; - public static void main(String[] args) throws Throwable { - BaseBlock block = FaweCache.getBlock(0, 0); - DiskOptimizedClipboard clip = new DiskOptimizedClipboard(443, 256, 443, new File("test")); - start = System.currentTimeMillis(); - clip.forEach(new BlockReader() { - @Override - public void run(int x, int y, int z, BaseBlock value2) { - - } - }, true); - clip.close(); -// BufferedRandomAccessFile raf = new BufferedRandomAccessFile(new File("test"), "rw"); -// int len = 50000000; -// raf.setLength(len * 2); -// long start = System.currentTimeMillis(); -// long total = 0; -// for (int i = 0; i < len; i++) { -// total += raf.readChar(); -// } -// raf.close(); - System.out.println(System.currentTimeMillis() - start + "ms"); -// System.out.println("Total " + total); - System.exit(1); - } - @Override public void streamDatas(NBTStreamer.ByteReader task) { try { @@ -324,7 +299,7 @@ public class DiskOptimizedClipboard extends FaweClipboard implements Closeable { int combinedId = raf.readChar(); if (combinedId != 0) { BaseBlock block = FaweCache.CACHE_BLOCK[combinedId]; - if (FaweCache.hasNBT(block.getId())) { + if (block.canStoreNBTData()) { trio.set(x, y, z); CompoundTag nbt = nbtMap.get(trio); if (nbt != null) { @@ -357,7 +332,7 @@ public class DiskOptimizedClipboard extends FaweClipboard implements Closeable { last = i; int combinedId = raf.readChar(); BaseBlock block = FaweCache.CACHE_BLOCK[combinedId]; - if (FaweCache.hasNBT(block.getId())) { + if (block.canStoreNBTData()) { CompoundTag nbt = nbtMap.get(new IntegerTrio(x, y, z)); if (nbt != null) { block = new BaseBlock(block.getId(), block.getData()); 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 84dd2d31..e351a8bd 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 @@ -160,7 +160,6 @@ public class SchematicWriter implements ClipboardWriter { public void run(int index, int byteValue) { try { if (byteValue >= 256) { - System.out.println("Add block"); hasAdd = true; } if (FaweCache.hasData(byteValue)) { @@ -202,7 +201,6 @@ public class SchematicWriter implements ClipboardWriter { @Override public void run(int index, int byteValue) { try { - System.out.println("Add " + (byteValue >> 8)); rawStream.writeByte(byteValue >> 8); } catch (IOException e) { e.printStackTrace();