From 7d9abc92733f85f3e6708008fa2dc95e19f835a5 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Mon, 23 Aug 2021 21:46:50 +0100 Subject: [PATCH] Skip corrupt tile entities in legacy schematics --- .../extent/clipboard/io/MCEditSchematicReader.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/MCEditSchematicReader.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/MCEditSchematicReader.java index ade1e2624..a5cc43e09 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/MCEditSchematicReader.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/io/MCEditSchematicReader.java @@ -203,6 +203,13 @@ public class MCEditSchematicReader extends NBTSchematicReader { int z = t.getInt("z"); int index = y * width * length + z * width + x; + //FAWE start - tile entity safety - perhaps caused by the old issue with tile entities created in the wrong + // position in schematics? + if (index >= blocks.length) { + LOGGER.warn("Skipping corrupt tile entity at position " + x + " " + y + " " + z + " in schematic."); + continue; + } + BlockState block = getBlockState(blocks[index], blockData[index]); BlockState newBlock = block; if (newBlock != null) {