From 6b5f21d67bfe6badd4d893fb58e2ece22e7bdcd8 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Fri, 24 Sep 2021 16:41:09 +0100 Subject: [PATCH] Support old, corrupt, schematics --- .../core/extent/clipboard/io/FastSchematicReader.java | 5 ++++- .../extent/clipboard/io/SpongeSchematicReader.java | 9 +++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicReader.java b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicReader.java index 19782fab8..7a36a7424 100644 --- a/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicReader.java +++ b/worldedit-core/src/main/java/com/fastasyncworldedit/core/extent/clipboard/io/FastSchematicReader.java @@ -71,7 +71,6 @@ public class FastSchematicReader extends NBTSchematicReader { private List> tiles; private List> entities; - private int width; private int height; private int length; @@ -339,6 +338,10 @@ public class FastSchematicReader extends NBTSchematicReader { values.put("y", new IntTag(y)); values.put("z", new IntTag(z)); values.put("id", id); + } else if (values.get("id") != null) { + values.put("x", new IntTag(x)); + values.put("y", new IntTag(y)); + values.put("z", new IntTag(z)); } values.remove("Id"); values.remove("Pos"); 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 66930dfcc..de1e2afbe 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 @@ -258,6 +258,15 @@ public class SpongeSchematicReader extends NBTSchematicReader { values.put("x", new IntTag(pt.getBlockX())); values.put("y", new IntTag(pt.getBlockY())); values.put("z", new IntTag(pt.getBlockZ())); + //FAWE start - support old, corrupt schematics + Tag id = values.get("Id"); + if (id == null) { + id = values.get("id"); + } + if (id == null) { + continue; + } + //FAWE end values.put("id", values.get("Id")); values.remove("Id"); values.remove("Pos");