From 1a6bc6f42ca951fb53a9695b5e35e760e2784a83 Mon Sep 17 00:00:00 2001 From: Wizjany Date: Sun, 18 Sep 2011 18:51:03 -0400 Subject: [PATCH] Fixed AIOOBE and a missing return, removed an unused and ambiguous method from CommandContext. --- .../com/sk89q/minecraft/util/commands/CommandContext.java | 4 ---- .../java/com/sk89q/worldedit/commands/SelectionCommands.java | 3 ++- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/java/com/sk89q/minecraft/util/commands/CommandContext.java b/src/main/java/com/sk89q/minecraft/util/commands/CommandContext.java index dfc99f3c0..0f2463652 100644 --- a/src/main/java/com/sk89q/minecraft/util/commands/CommandContext.java +++ b/src/main/java/com/sk89q/minecraft/util/commands/CommandContext.java @@ -221,10 +221,6 @@ public class CommandContext { return Double.parseDouble(value); } - public int length() { - return args.length; - } - public int argsLength() { return args.length - 1; } diff --git a/src/main/java/com/sk89q/worldedit/commands/SelectionCommands.java b/src/main/java/com/sk89q/worldedit/commands/SelectionCommands.java index b17452c27..7e5f3e9ba 100644 --- a/src/main/java/com/sk89q/worldedit/commands/SelectionCommands.java +++ b/src/main/java/com/sk89q/worldedit/commands/SelectionCommands.java @@ -585,8 +585,9 @@ public class SelectionCommands { LocalSession session, LocalPlayer player, EditSession editSession) throws WorldEditException { - if (args.length() == 0) { + if (args.argsLength() == 0) { session.getRegionSelector(player.getWorld()).clear(); + return; } String typeName = args.getString(0); if (typeName.equalsIgnoreCase("cuboid")) {