From e724b1f1cdd14a96c95c1441e2781f37ebaf2162 Mon Sep 17 00:00:00 2001 From: Gerrygames Date: Fri, 1 Feb 2019 13:40:22 +0100 Subject: [PATCH] fix NPE when reading sponge schematics with tile entities or entities --- .../worldedit/extent/clipboard/io/SpongeSchematicReader.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SpongeSchematicReader.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SpongeSchematicReader.java index 4c54af4e8..a33dc7c1e 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SpongeSchematicReader.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/SpongeSchematicReader.java @@ -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;