From aed274a1a57db474e68008aaa11e5ab9067b86ab Mon Sep 17 00:00:00 2001 From: sk89q Date: Sat, 29 Jan 2011 12:01:14 -0800 Subject: [PATCH] Added //paste [-ao] syntax to paste without air and at origin. --- .../worldedit/commands/ClipboardCommands.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/com/sk89q/worldedit/commands/ClipboardCommands.java b/src/com/sk89q/worldedit/commands/ClipboardCommands.java index 5b3e663ba..2d11cc979 100644 --- a/src/com/sk89q/worldedit/commands/ClipboardCommands.java +++ b/src/com/sk89q/worldedit/commands/ClipboardCommands.java @@ -95,29 +95,28 @@ public class ClipboardCommands { @Command( aliases = {"/paste"}, - usage = "[at-origin?]", + usage = "", + flags = "ao", desc = "Paste the clipboard's contents", min = 0, - max = 1 + max = 0 ) @CommandPermissions({"worldedit.clipboard.paste"}) public static void paste(CommandContext args, WorldEdit we, LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { - boolean atOrigin = args.argsLength() > 0 - ? (args.getString(0).equalsIgnoreCase("true") - || args.getString(0).equalsIgnoreCase("yes")) - : false; + boolean atOrigin = args.hasFlag('o'); + boolean pasteNoAir = args.hasFlag('a'); if (atOrigin) { Vector pos = session.getClipboard().getOrigin(); - session.getClipboard().place(editSession, pos, false); + session.getClipboard().place(editSession, pos, pasteNoAir); player.findFreePosition(); player.print("Pasted to copy origin. Undo with //undo"); } else { Vector pos = session.getPlacementPosition(player); - session.getClipboard().paste(editSession, pos, false); + session.getClipboard().paste(editSession, pos, pasteNoAir); player.findFreePosition(); player.print("Pasted relative to you. Undo with //undo"); }