This commit is contained in:
Norbi Peti 2016-10-06 20:16:32 +02:00
parent 60d35d8eae
commit 596c929ace
2 changed files with 5 additions and 4 deletions

View file

@ -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;
}

View file

@ -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!");