This commit is contained in:
Brady 2019-12-19 22:15:14 -06:00
parent eea5b69b6c
commit 0a858c040c
No known key found for this signature in database
GPG Key ID: 73A788379A197567
2 changed files with 4 additions and 6 deletions

View File

@ -100,7 +100,7 @@ public enum SpongeParser implements ISchematicParser {
int[] blockData = new int[this.x * this.y * this.z];
int offset = 0;
for (int i = 0; i < blockData.length; i++) {
if (offset >= blockData.length) {
if (offset >= rawBlockData.length) {
throw new IllegalArgumentException("No remaining bytes in BlockData for complete schematic");
}
@ -150,11 +150,9 @@ public enum SpongeParser implements ISchematicParser {
this.properties.keySet().stream().sorted(String::compareTo).forEachOrdered(key -> {
IProperty<?> property = block.getBlockState().getProperty(key);
if (property == null) {
throw new IllegalArgumentException("Invalid property");
if (property != null) {
this.blockState = setPropertyValue(this.blockState, property, this.properties.get(key));
}
this.blockState = setPropertyValue(this.blockState, property, this.properties.get(key));
});
}
return this.blockState;

View File

@ -57,7 +57,7 @@ public final class VarInt {
private static byte[] serialize0(int value) {
ByteList bytes = new ByteArrayList();
while ((value & 0xFF) != 0) {
while ((value & 0x80) != 0) {
bytes.add((byte) (value & 0x7F | 0x80));
value >>>= 7;
}