From 8593c2df9f241cb1f59375ea39247628389b4212 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Thu, 23 Sep 2021 12:42:51 +0100 Subject: [PATCH] Rearrange DOC methods --- .../clipboard/DiskOptimizedClipboard.java | 52 +++++++++---------- 1 file changed, 26 insertions(+), 26 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 23db8f75a..6d598099c 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 @@ -129,24 +129,6 @@ public class DiskOptimizedClipboard extends LinearClipboard implements Closeable } } - @Override - public URI getURI() { - return file.toURI(); - } - - 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); - } - return BlockVector3.at(is.readChar(), is.readChar(), is.readChar()); - } catch (IOException e) { - e.printStackTrace(); - throw new RuntimeException(e); - } - } - public DiskOptimizedClipboard(File file) { super(readSize(file)); nbtMap = new HashMap<>(); @@ -165,6 +147,24 @@ 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); + } + return BlockVector3.at(is.readChar(), is.readChar(), is.readChar()); + } catch (IOException e) { + e.printStackTrace(); + throw new RuntimeException(e); + } + } + + @Override + public URI getURI() { + return file.toURI(); + } + public File getFile() { return file; } @@ -290,6 +290,14 @@ public class DiskOptimizedClipboard extends LinearClipboard implements Closeable return null; } + @Override + public BlockVector3 getOrigin() { + int ox = byteBuffer.getShort(8); + int oy = byteBuffer.getShort(10); + int oz = byteBuffer.getShort(12); + return BlockVector3.at(ox, oy, oz); + } + @Override public void setOrigin(BlockVector3 offset) { super.setOrigin(offset); @@ -302,14 +310,6 @@ public class DiskOptimizedClipboard extends LinearClipboard implements Closeable } } - @Override - public BlockVector3 getOrigin() { - int ox = byteBuffer.getShort(8); - int oy = byteBuffer.getShort(10); - int oz = byteBuffer.getShort(12); - return BlockVector3.at(ox, oy, oz); - } - private void setOffset(BlockVector3 offset) { if (version == 0) { return;