From e1ba16b699cf9c3b4f9e2e256eb3a1083c451a1f Mon Sep 17 00:00:00 2001 From: IronApollo Date: Thu, 16 Apr 2020 20:27:38 -0400 Subject: [PATCH] Fix #403 --- .../java/com/sk89q/worldedit/command/ClipboardCommands.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java index 5f79e9570..4797e7dda 100644 --- a/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java +++ b/worldedit-core/src/main/java/com/sk89q/worldedit/command/ClipboardCommands.java @@ -119,6 +119,8 @@ public class ClipboardCommands { boolean copyEntities, @Switch(name = 'b', desc = "Also copy biomes") boolean copyBiomes, + @Switch(name = 'c', desc = "Set the origin of the clipboard to the center of the copied region") + boolean centerClipboard, @ArgFlag(name = 'm', desc = "Set the include mask, non-matching blocks become air", def = "") Mask mask) throws WorldEditException { BlockVector3 min = region.getMinimumPoint(); @@ -134,7 +136,7 @@ public class ClipboardCommands { Clipboard clipboard = new BlockArrayClipboard(region, actor.getUniqueId()); - clipboard.setOrigin(session.getPlacementPosition(actor)); + clipboard.setOrigin(centerClipboard ? region.getCenter().toBlockPoint() : session.getPlacementPosition(actor)); ForwardExtentCopy copy = new ForwardExtentCopy(editSession, region, clipboard, region.getMinimumPoint()); copy.setCopyingEntities(copyEntities); copy.setCopyingBiomes(copyBiomes);