Don't stop edits for old clipboards, attempt to load them anyway (for now)

This commit is contained in:
dordsor21 2021-09-24 09:32:49 +01:00
parent 8593c2df9f
commit bfd9e5b347
No known key found for this signature in database
GPG Key ID: 1E53E88969FFCF0B

View File

@ -150,9 +150,15 @@ public class DiskOptimizedClipboard extends LinearClipboard implements Closeable
private static BlockVector3 readSize(File file) { private static BlockVector3 readSize(File file) {
try (DataInputStream is = new DataInputStream(new FileInputStream(file))) { try (DataInputStream is = new DataInputStream(new FileInputStream(file))) {
int version = is.readChar(); int version = is.readChar();
if (version > VERSION) { int x;
throw new UnsupportedOperationException("Unsupported clipboard-on-disk version: " + version); 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()); return BlockVector3.at(is.readChar(), is.readChar(), is.readChar());
} catch (IOException e) { } catch (IOException e) {
e.printStackTrace(); e.printStackTrace();