Fix schem load

This commit is contained in:
Jesse Boyd
2019-11-01 23:48:52 +01:00
parent 09bb9c18ca
commit c2cb463dae
4 changed files with 11 additions and 5 deletions

View File

@ -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];