From 596c929ace3f284564ed45f39f8139a585c0ab6b Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Thu, 6 Oct 2016 20:16:32 +0200 Subject: [PATCH] Fixes --- .../java/buttondevteam/chat/commands/CommandCaller.java | 7 ++++--- .../chat/commands/ucmds/admin/UpdatePlugin.java | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/buttondevteam/chat/commands/CommandCaller.java b/src/main/java/buttondevteam/chat/commands/CommandCaller.java index 96dfae8..2bb04af 100644 --- a/src/main/java/buttondevteam/chat/commands/CommandCaller.java +++ b/src/main/java/buttondevteam/chat/commands/CommandCaller.java @@ -95,12 +95,13 @@ public class CommandCaller implements CommandExecutor { sender.sendMessage("§cOnly ingame players can use this command."); return true; } + final String[] cmdargs = args.length > 0 ? Arrays.copyOfRange(args, args.length - argc, args.length) : args; try { - if (!cmd.OnCommand(sender, alias, - (args.length > 0 ? Arrays.copyOfRange(args, args.length - argc, args.length) : args))) + if (!cmd.OnCommand(sender, alias, cmdargs)) sender.sendMessage(cmd.GetHelpText(alias)); } catch (Exception e) { - TBMCDiscordAPI.SendException(e, "Failed to execute command " + cmd.GetCommandPath() + " with arguments "); + TBMCDiscordAPI.SendException(e, + "Failed to execute command " + cmd.GetCommandPath() + " with arguments " + cmdargs); } return true; } diff --git a/src/main/java/buttondevteam/chat/commands/ucmds/admin/UpdatePlugin.java b/src/main/java/buttondevteam/chat/commands/ucmds/admin/UpdatePlugin.java index c14670e..b44edf4 100644 --- a/src/main/java/buttondevteam/chat/commands/ucmds/admin/UpdatePlugin.java +++ b/src/main/java/buttondevteam/chat/commands/ucmds/admin/UpdatePlugin.java @@ -29,7 +29,7 @@ public class UpdatePlugin extends AdminCommandBase { sender.sendMessage("Updating plugin..."); String ret = ""; if ((ret = TBMCCoreAPI.UpdatePlugin(args[0])).length() > 0) { - sender.sendMessage("Internal error: " + ret); + sender.sendMessage(ret); return true; } sender.sendMessage("Updating done!");