From 76bce7c0efb720153b00ab7675f31d23d2b64315 Mon Sep 17 00:00:00 2001 From: Jesse Boyd Date: Thu, 14 Jul 2016 20:29:11 +1000 Subject: [PATCH] Catch CommandException --- .../main/java/com/plotsquared/general/commands/Command.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Core/src/main/java/com/plotsquared/general/commands/Command.java b/Core/src/main/java/com/plotsquared/general/commands/Command.java index de19e75a1..5152b0e10 100644 --- a/Core/src/main/java/com/plotsquared/general/commands/Command.java +++ b/Core/src/main/java/com/plotsquared/general/commands/Command.java @@ -333,7 +333,11 @@ public abstract class Command { if (!cmd.checkArgs(player, newArgs) || !cmd.canExecute(player, true)) { return; } - cmd.execute(player, newArgs, confirm, whenDone); + try { + cmd.execute(player, newArgs, confirm, whenDone); + } catch (CommandException e) { + e.perform(player); + } } public boolean checkArgs(PlotPlayer player, String[] args) {