From c58f8f41553db3f2d565f28c94d3b874d97f129f Mon Sep 17 00:00:00 2001 From: sk89q Date: Fri, 25 Feb 2011 08:59:10 -0800 Subject: [PATCH] Fixed handling of CommandExceptions thrown by commands. --- src/com/sk89q/minecraft/util/commands/CommandsManager.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/com/sk89q/minecraft/util/commands/CommandsManager.java b/src/com/sk89q/minecraft/util/commands/CommandsManager.java index bd725b1fe..77ee41716 100644 --- a/src/com/sk89q/minecraft/util/commands/CommandsManager.java +++ b/src/com/sk89q/minecraft/util/commands/CommandsManager.java @@ -346,6 +346,10 @@ public void executeMethod(Method parent, String[] args, } catch (IllegalAccessException e) { e.printStackTrace(); } catch (InvocationTargetException e) { + if (e.getCause() instanceof CommandException) { + throw (CommandException) e.getCause(); + } + throw new WrappedCommandException(e.getCause()); } }