From bfd9e5b34707963ae547ed8c8d30b7d22949d906 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Fri, 24 Sep 2021 09:32:49 +0100 Subject: [PATCH] Don't stop edits for old clipboards, attempt to load them anyway (for now) --- .../core/extent/clipboard/DiskOptimizedClipboard.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/DiskOptimizedClipboard.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/DiskOptimizedClipboard.java index 6d598099c..2c447aea0 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/DiskOptimizedClipboard.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/DiskOptimizedClipboard.java @@ -150,9 +150,15 @@ public class DiskOptimizedClipboard extends LinearClipboard implements Closeable private static BlockVector3 readSize(File file) { try (DataInputStream is = new DataInputStream(new FileInputStream(file))) { int version = is.readChar(); - if (version > VERSION) { - throw new UnsupportedOperationException("Unsupported clipboard-on-disk version: " + version); + int x; + if (version != 1) { + x = version; + } else { + x = is.readChar(); } +// if (version > VERSION) { +// throw new UnsupportedOperationException("Unsupported clipboard-on-disk version: " + version); +// } return BlockVector3.at(is.readChar(), is.readChar(), is.readChar()); } catch (IOException e) { e.printStackTrace();