mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-22 17:27:38 +00:00
Fix schem load
This commit is contained in:
parent
09bb9c18ca
commit
c2cb463dae
@ -156,11 +156,11 @@ public class StreamDelegate {
|
||||
}
|
||||
|
||||
public StreamDelegate withLong(LongValueReader valueReader) {
|
||||
return withValue(valueReader);
|
||||
return withElem(valueReader);
|
||||
}
|
||||
|
||||
public StreamDelegate withInt(IntValueReader valueReader) {
|
||||
return withValue(valueReader);
|
||||
return withElem(valueReader);
|
||||
}
|
||||
|
||||
public StreamDelegate withValue(ValueReader valueReader) {
|
||||
|
@ -183,6 +183,7 @@ public final class NBTInputStream implements Closeable {
|
||||
return;
|
||||
case NBTConstants.TYPE_BYTE: {
|
||||
ValueReader value = scope.getValueReader();
|
||||
if (value == null) value = scope.getElemReader();
|
||||
if (value != null) {
|
||||
value.applyInt(0, is.readByte());
|
||||
} else {
|
||||
@ -192,6 +193,7 @@ public final class NBTInputStream implements Closeable {
|
||||
}
|
||||
case NBTConstants.TYPE_SHORT: {
|
||||
ValueReader value = scope.getValueReader();
|
||||
if (value == null) value = scope.getElemReader();
|
||||
if (value != null) {
|
||||
value.applyInt(0, is.readShort());
|
||||
} else {
|
||||
@ -201,6 +203,7 @@ public final class NBTInputStream implements Closeable {
|
||||
}
|
||||
case NBTConstants.TYPE_INT: {
|
||||
ValueReader value = scope.getValueReader();
|
||||
if (value == null) value = scope.getElemReader();
|
||||
if (value != null) {
|
||||
value.applyInt(0, is.readInt());
|
||||
} else {
|
||||
@ -210,6 +213,7 @@ public final class NBTInputStream implements Closeable {
|
||||
}
|
||||
case NBTConstants.TYPE_LONG: {
|
||||
ValueReader value = scope.getValueReader();
|
||||
if (value == null) value = scope.getElemReader();
|
||||
if (value != null) {
|
||||
value.applyLong(0, is.readLong());
|
||||
} else {
|
||||
@ -219,6 +223,7 @@ public final class NBTInputStream implements Closeable {
|
||||
}
|
||||
case NBTConstants.TYPE_FLOAT: {
|
||||
ValueReader value = scope.getValueReader();
|
||||
if (value == null) value = scope.getElemReader();
|
||||
if (value != null) {
|
||||
value.applyFloat(0, is.readFloat());
|
||||
} else {
|
||||
@ -228,6 +233,7 @@ public final class NBTInputStream implements Closeable {
|
||||
}
|
||||
case NBTConstants.TYPE_DOUBLE: {
|
||||
ValueReader value = scope.getValueReader();
|
||||
if (value == null) value = scope.getElemReader();
|
||||
if (value != null) {
|
||||
value.applyDouble(0, is.readDouble());
|
||||
} else {
|
||||
@ -237,6 +243,7 @@ public final class NBTInputStream implements Closeable {
|
||||
}
|
||||
case NBTConstants.TYPE_STRING: {
|
||||
ValueReader value = scope.getValueReader();
|
||||
if (value == null) value = scope.getElemReader();
|
||||
int length = is.readShort() & 0xFFFF;
|
||||
if (value != null) {
|
||||
byte[] bytes = new byte[length];
|
||||
|
@ -591,7 +591,6 @@ public class SchematicCommands {
|
||||
String filter,
|
||||
Arguments arguments
|
||||
) throws WorldEditException {
|
||||
if (formatName.isEmpty()) formatName = null;
|
||||
if (oldFirst && newFirst) {
|
||||
throw new StopExecutionException(TextComponent.of("Cannot sort by oldest and newest."));
|
||||
}
|
||||
|
@ -251,7 +251,7 @@ public class SpongeSchematicReader extends NBTSchematicReader {
|
||||
if (offsetX != Integer.MIN_VALUE && offsetY != Integer.MIN_VALUE && offsetZ != Integer.MIN_VALUE) {
|
||||
origin = origin.subtract(BlockVector3.at(offsetX, offsetY, offsetZ));
|
||||
}
|
||||
if (blocksOut.getSize() != 0) {
|
||||
if (blocksOut != null && blocksOut.getSize() != 0) {
|
||||
try (FaweInputStream fis = new FaweInputStream(new LZ4BlockInputStream(new FastByteArraysInputStream(blocksOut.toByteArrays())))) {
|
||||
if (clipboard instanceof LinearClipboard) {
|
||||
LinearClipboard linear = (LinearClipboard) clipboard;
|
||||
@ -286,7 +286,7 @@ public class SpongeSchematicReader extends NBTSchematicReader {
|
||||
}
|
||||
}
|
||||
}
|
||||
if (biomesOut.getSize() != 0) {
|
||||
if (biomesOut != null && biomesOut.getSize() != 0) {
|
||||
try (FaweInputStream fis = new FaweInputStream(new LZ4BlockInputStream(new FastByteArraysInputStream(biomesOut.toByteArrays())))) {
|
||||
if (clipboard instanceof LinearClipboard) {
|
||||
LinearClipboard linear = (LinearClipboard) clipboard;
|
||||
|
Loading…
Reference in New Issue
Block a user