From 8f8d991ee1d75f4d46e1972157015eb97bc0daf8 Mon Sep 17 00:00:00 2001 From: sk89q Date: Tue, 1 Jul 2014 15:04:30 -0700 Subject: [PATCH] Fixed /butcher not working correctly in-game. @Optional does not work on parameter bindings of the PROVIDES type at this time. Fixes WORLDEDIT-3139. --- .../java/com/sk89q/worldedit/command/UtilityCommands.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java b/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java index 7f596c8e3..d57bedd28 100644 --- a/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java +++ b/src/main/java/com/sk89q/worldedit/command/UtilityCommands.java @@ -375,9 +375,9 @@ public class UtilityCommands { ) @CommandPermissions("worldedit.butcher") @Logging(PLACEMENT) - public void butcher(Actor actor, @Optional Player player, @Optional LocalSession session, CommandContext args) throws WorldEditException { - + public void butcher(Actor actor, CommandContext args) throws WorldEditException { LocalConfiguration config = we.getConfiguration(); + Player player = actor instanceof Player ? (Player) actor : null; // technically the default can be larger than the max, but that's not my problem int radius = config.butcherDefaultRadius; @@ -407,6 +407,7 @@ public class UtilityCommands { int killed; if (player != null) { + LocalSession session = we.getSessionManager().get(player); killed = player.getWorld().killMobs(session.getPlacementPosition(player), radius, flags.flags); } else { killed = 0;