From 0bc9369cc8c68924e05748ae621692e416be7ef0 Mon Sep 17 00:00:00 2001 From: TomyLobo Date: Thu, 16 Aug 2012 15:30:16 +0200 Subject: [PATCH] Made /butcher print the radius it uses and added an "all" parameter. --- .../worldedit/commands/UtilityCommands.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/commands/UtilityCommands.java b/src/main/java/com/sk89q/worldedit/commands/UtilityCommands.java index bf6abab7f..1e6e856cc 100644 --- a/src/main/java/com/sk89q/worldedit/commands/UtilityCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/UtilityCommands.java @@ -367,11 +367,16 @@ public class UtilityCommands { EditSession editSession) throws WorldEditException { LocalConfiguration config = we.getConfiguration(); - + final int radius; - - if(args.argsLength() > 0){ - radius = Math.max(1, args.getInteger(0)); + + if (args.argsLength() > 0) { + if (args.getString(0).equals("all")) { + radius = -1; + } + else { + radius = Math.max(1, args.getInteger(0)); + } } else{ radius = config.butcherDefaultRadius; @@ -395,7 +400,10 @@ public class UtilityCommands { } } - player.print("Killed " + killed + " mobs."); + if (radius < 0) + player.print("Killed " + killed + " mobs."); + else + player.print("Killed " + killed + " mobs in a radius of "+radius+"."); } public class FlagContainer {