From 848eac86233a7e61d18826a1a7f918763ea541b2 Mon Sep 17 00:00:00 2001 From: dordsor21 Date: Tue, 28 Sep 2021 13:16:26 +0100 Subject: [PATCH] Fix schematic offset when loaded to clipboard --- .../core/extent/clipboard/io/FastSchematicReader.java | 5 ++++- .../worldedit/extent/clipboard/BlockArrayClipboard.java | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) 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 7a36a7424..b4e26e1a4 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 @@ -237,7 +237,10 @@ public class FastSchematicReader extends NBTSchematicReader { inputStream.readNamedTagLazy(root); if (version != 1 && version != 2) { - throw new IOException("This schematic version is not supported; Version: " + version + ", DataVersion: " + dataVersion + ". It's very likely your schematic has an invalid file extension, if the schematic has been created on a version lower than 1.13.2, the extension MUST be `.schematic`, elsewise the schematic can't be read properly."); + throw new IOException("This schematic version is not supported; Version: " + version + + ", DataVersion: " + dataVersion + ". It's very likely your schematic has an invalid file extension," + + " if the schematic has been created on a version lower than 1.13.2, the extension MUST be `.schematic`," + + " elsewise the schematic can't be read properly."); } if (blocks != null) { diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java index 633686107..d0d71a3cb 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/extent/clipboard/BlockArrayClipboard.java @@ -95,7 +95,7 @@ public class BlockArrayClipboard implements Clipboard { shifted.shift(offset); this.region = shifted; this.offset = shifted.getMinimumPoint(); - this.origin = parent.getOrigin(); + this.origin = parent.getOrigin().add(this.offset); } /**