From aadfc30fbbdbec90d5ca9946e4c5567facae7341 Mon Sep 17 00:00:00 2001 From: Wizjany Date: Thu, 22 Nov 2012 13:28:36 -0500 Subject: [PATCH] Fix issues with 94619e3f. Closes WORLDEDIT-2221. --- .../worldedit/commands/UtilityCommands.java | 32 ++++++++++++------- src/main/resources/config.yml | 2 +- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/commands/UtilityCommands.java b/src/main/java/com/sk89q/worldedit/commands/UtilityCommands.java index 1e6e856cc..22b755b42 100644 --- a/src/main/java/com/sk89q/worldedit/commands/UtilityCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/UtilityCommands.java @@ -19,6 +19,8 @@ package com.sk89q.worldedit.commands; +import static com.sk89q.minecraft.util.commands.Logging.LogMode.PLACEMENT; + import java.util.Comparator; import java.util.Set; import java.util.SortedSet; @@ -30,11 +32,19 @@ import com.sk89q.minecraft.util.commands.CommandPermissions; import com.sk89q.minecraft.util.commands.CommandsManager; import com.sk89q.minecraft.util.commands.Console; import com.sk89q.minecraft.util.commands.Logging; -import static com.sk89q.minecraft.util.commands.Logging.LogMode.*; -import com.sk89q.worldedit.*; +import com.sk89q.worldedit.EditSession; +import com.sk89q.worldedit.EntityType; +import com.sk89q.worldedit.LocalConfiguration; +import com.sk89q.worldedit.LocalPlayer; +import com.sk89q.worldedit.LocalSession; +import com.sk89q.worldedit.LocalWorld; import com.sk89q.worldedit.LocalWorld.KillFlags; +import com.sk89q.worldedit.Vector; +import com.sk89q.worldedit.WorldEdit; +import com.sk89q.worldedit.WorldEditException; import com.sk89q.worldedit.blocks.BaseBlock; -import com.sk89q.worldedit.patterns.*; +import com.sk89q.worldedit.patterns.Pattern; +import com.sk89q.worldedit.patterns.SingleBlockPattern; import com.sk89q.worldedit.regions.CuboidRegion; import com.sk89q.worldedit.regions.Region; @@ -368,19 +378,15 @@ public class UtilityCommands { LocalConfiguration config = we.getConfiguration(); - final int radius; + int radius = config.butcherDefaultRadius; if (args.argsLength() > 0) { if (args.getString(0).equals("all")) { radius = -1; - } - else { + } else { radius = Math.max(1, args.getInteger(0)); } } - else{ - radius = config.butcherDefaultRadius; - } FlagContainer flags = new FlagContainer(player); flags.or(KillFlags.FRIENDLY , args.hasFlag('f')); @@ -400,10 +406,11 @@ public class UtilityCommands { } } - if (radius < 0) + if (radius < 0) { player.print("Killed " + killed + " mobs."); - else - player.print("Killed " + killed + " mobs in a radius of "+radius+"."); + } else { + player.print("Killed " + killed + " mobs in a radius of " + radius + "."); + } } public class FlagContainer { @@ -496,6 +503,7 @@ public class UtilityCommands { if (args.argsLength() == 0) { SortedSet commands = new TreeSet(new Comparator() { + @Override public int compare(String o1, String o2) { final int ret = o1.replaceAll("/", "").compareToIgnoreCase(o2.replaceAll("/", "")); if (ret == 0) { diff --git a/src/main/resources/config.yml b/src/main/resources/config.yml index a6ba4921c..63bb26063 100644 --- a/src/main/resources/config.yml +++ b/src/main/resources/config.yml @@ -58,7 +58,7 @@ history: expiration: 10 butcher: - butcher-default-radius: -1 + butcher-default-radius: -1 wand-item: 271 shell-save-type: