From a5ac9514abfe867deee7009911f954e07f4ea20d Mon Sep 17 00:00:00 2001 From: sk89q Date: Tue, 12 Oct 2010 22:10:17 -0700 Subject: [PATCH] Added /toggleeditwand, removed unused tool click stuff. --- src/WorldEdit.java | 12 ++++++++++++ src/WorldEditSession.java | 32 -------------------------------- 2 files changed, 12 insertions(+), 32 deletions(-) diff --git a/src/WorldEdit.java b/src/WorldEdit.java index 63fb109d8..4bb73689e 100644 --- a/src/WorldEdit.java +++ b/src/WorldEdit.java @@ -70,6 +70,7 @@ public class WorldEdit { commands.put("/editpos1", "Set editing position #1"); commands.put("/editpos2", "Set editing position #2"); commands.put("/editwand", "Gives you the \"edit wand\""); + commands.put("/toggleeditwand", "Toggles edit wand selection"); commands.put("/editundo", "Undo"); commands.put("/editredo", "Redo"); commands.put("/clearhistory", "Clear history"); @@ -245,6 +246,17 @@ public class WorldEdit { player.print("Right click = sel. pos 1; double right click = sel. pos 2"); return true; + // Toggle edit wand + } else if (split[0].equalsIgnoreCase("/toggleeditwand")) { + checkArgs(split, 0, 0, split[0]); + session.setToolControl(!session.isToolControlEnabled()); + if (session.isToolControlEnabled()) { + player.print("Edit wand enabled."); + } else { + player.print("Edit wand disabled."); + } + return true; + // Set max number of blocks to change at a time } else if (split[0].equalsIgnoreCase("/editlimit")) { checkArgs(split, 1, 1, split[0]); diff --git a/src/WorldEditSession.java b/src/WorldEditSession.java index 3d88649aa..202e4fa71 100644 --- a/src/WorldEditSession.java +++ b/src/WorldEditSession.java @@ -32,8 +32,6 @@ public class WorldEditSession { private int historyPointer = 0; private CuboidClipboard clipboard; private boolean toolControl = true; - private Vector lastToolPos1; - private long lastToolClick = 0; private int maxBlocksChanged = -1; /** @@ -219,36 +217,6 @@ public class WorldEditSession { this.toolControl = toolControl; } - /** - * @return the lastToolPos1 - */ - public Vector getLastToolPos1() { - return lastToolPos1; - } - - /** - * @param lastToolPos1 the lastToolPos1 to set - */ - public void setLastToolPos1(Vector lastToolPos1) { - this.lastToolPos1 = lastToolPos1; - } - - /** - * Returns true if the tool has been double clicked. - * - * @return true if double clicked - */ - public boolean hasToolBeenDoubleClicked() { - return System.currentTimeMillis() - lastToolClick < 500; - } - - /** - * Triggers a click of the tool. - */ - public void triggerToolClick() { - lastToolClick = System.currentTimeMillis(); - } - /** * Get the maximum number of blocks that can be changed in an edit session. *