diff --git a/src/WorldEditListener.java b/src/WorldEditListener.java index 50d400af1..b1f3bdad0 100755 --- a/src/WorldEditListener.java +++ b/src/WorldEditListener.java @@ -142,6 +142,7 @@ public class WorldEditListener extends PluginListener { commands.put("//tool", "[Tool] - Set pickaxe tool (none/tree/info)"); commands.put("//expand", "[Num] - Expands the selection"); commands.put("//contract", "[Num] - Contracts the selection"); + commands.put("//shift", "[Num] - Shift the selection"); commands.put("//rotate", "[Angle] - Rotate the clipboard"); commands.put("//flip", " - Flip the clipboard"); commands.put("//hcyl", "[ID] [Radius] - Create a vertical hollow cylinder"); @@ -1247,6 +1248,25 @@ public class WorldEditListener extends PluginListener { return true; + // Shift + } else if (split[0].equalsIgnoreCase("//shift")) { + checkArgs(split, 1, 2, split[0]); + Vector dir; + int change = Integer.parseInt(split[1]); + if (split.length == 3) { + dir = getDirection(player, split[2].toLowerCase()); + } else { + dir = getDirection(player, "me"); + } + + Region region = session.getRegion(); + region.expand(dir.multiply(change)); + region.contract(dir.multiply(change)); + session.learnRegionChanges(); + player.print("Region shifted."); + + return true; + // Rotate } else if (split[0].equalsIgnoreCase("//rotate")) { checkArgs(split, 1, 1, split[0]);