From 888683d83b8d35ef27b75ad41181d2edc5dcdbd7 Mon Sep 17 00:00:00 2001 From: Jordan Date: Fri, 7 Jul 2023 17:23:37 +0100 Subject: [PATCH] fix: ignore clipboard origin when pasting to match P2 behaviour (#2336) --- .../bukkit/regions/plotsquared/FaweDelegateRegionManager.java | 1 + .../bukkit/regions/plotsquared/FaweDelegateSchematicHandler.java | 1 + 2 files changed, 2 insertions(+) diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/FaweDelegateRegionManager.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/FaweDelegateRegionManager.java index e20c73809..66a9ef369 100644 --- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/FaweDelegateRegionManager.java +++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/FaweDelegateRegionManager.java @@ -183,6 +183,7 @@ public class FaweDelegateRegionManager { .findByFile(schematicFile) .getReader(new FileInputStream(schematicFile)) .read(); + clip.setOrigin(clip.getRegion().getMinimumPoint()); clip.paste(scheditsession, to, true, true, true); } catch (IOException e) { e.printStackTrace(); diff --git a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/FaweDelegateSchematicHandler.java b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/FaweDelegateSchematicHandler.java index 83de13f66..6cf09da28 100644 --- a/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/FaweDelegateSchematicHandler.java +++ b/worldedit-bukkit/src/main/java/com/fastasyncworldedit/bukkit/regions/plotsquared/FaweDelegateSchematicHandler.java @@ -152,6 +152,7 @@ public class FaweDelegateSchematicHandler { final BlockVector3 to = BlockVector3 .at(region.getMinimumPoint().getX() + xOffset, y_offset_actual, region.getMinimumPoint().getZ() + zOffset); final Clipboard clipboard = schematic.getClipboard(); + clipboard.setOrigin(clipboard.getRegion().getMinimumPoint()); clipboard.paste(editSession, to, true, false, true); if (whenDone != null) { whenDone.value = true;