From 91de441403bf9adfb232c20c8590e4ff83fb3a21 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Tue, 5 Jan 2021 17:21:35 +0000 Subject: [PATCH] No need to check WorldEdit schematics for bad entities --- .../worldedit/extent/clipboard/io/FastSchematicReader.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/FastSchematicReader.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/FastSchematicReader.java index 35a2f379b..9fdebeb06 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/FastSchematicReader.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/FastSchematicReader.java @@ -99,6 +99,7 @@ public class FastSchematicReader extends NBTSchematicReader { private char[] biomePalette; private BlockVector3 min = BlockVector3.ZERO; private boolean brokenEntities = false; + private boolean isWorldEdit = false; /** @@ -171,6 +172,10 @@ public class FastSchematicReader extends NBTSchematicReader { metadata.add("WEOffsetZ").withInt((i, v) -> offsetZ = v); metadata.add("FAWEVersion").withInt((i, v) -> faweWritten = v); + StreamDelegate worldEditSection = metadata.add("WorldEdit"); + worldEditSection.withValue((ValueReader) (index, v) -> isWorldEdit = true); + + StreamDelegate paletteDelegate = schematic.add("Palette"); paletteDelegate.withValue((ValueReader>) (ignore, v) -> { palette = new char[v.size()]; @@ -389,7 +394,7 @@ public class FastSchematicReader extends NBTSchematicReader { clipboard.createEntity(loc, state); continue; } - if (faweWritten == -1) { + if (!isWorldEdit && faweWritten == -1) { int locX = loc.getBlockX(); int locY = loc.getBlockY(); int locZ = loc.getBlockZ();