Mirror von
https://github.com/IntellectualSites/FastAsyncWorldEdit.git
synchronisiert 2024-12-26 19:02:36 +01:00
Rearrange DOC methods
Dieser Commit ist enthalten in:
Ursprung
07c02b5825
Commit
8593c2df9f
@ -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) {
|
public DiskOptimizedClipboard(File file) {
|
||||||
super(readSize(file));
|
super(readSize(file));
|
||||||
nbtMap = new HashMap<>();
|
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() {
|
public File getFile() {
|
||||||
return file;
|
return file;
|
||||||
}
|
}
|
||||||
@ -290,6 +290,14 @@ public class DiskOptimizedClipboard extends LinearClipboard implements Closeable
|
|||||||
return null;
|
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
|
@Override
|
||||||
public void setOrigin(BlockVector3 offset) {
|
public void setOrigin(BlockVector3 offset) {
|
||||||
super.setOrigin(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) {
|
private void setOffset(BlockVector3 offset) {
|
||||||
if (version == 0) {
|
if (version == 0) {
|
||||||
return;
|
return;
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren