Merge pull request #35 from Gerrygames/master

fix NPE when reading sponge schematics with tile entities or entities
This commit is contained in:
Josh Knight 2019-02-01 08:47:35 -05:00 committed by GitHub
commit be41e8dea0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -210,6 +210,7 @@ public class SpongeSchematicReader extends NBTSchematicReader {
});
streamer.readFully();
if (fc == null) setupClipboard(length * width * height, uuid);
else fc.setDimensions(new Vector(width, height, length));
Vector origin = min;
CuboidRegion region;
if (offsetX != Integer.MIN_VALUE && offsetY != Integer.MIN_VALUE && offsetZ != Integer.MIN_VALUE) {
@ -242,7 +243,6 @@ public class SpongeSchematicReader extends NBTSchematicReader {
}
}
}
fc.setDimensions(new Vector(width, height, length));
clipboard.init(region, fc);
clipboard.setOrigin(origin);
return clipboard;