use of cc.hyperium.utils.ChatColor in project Hyperium by HyperiumClient.
the class CommandDisableCommand method onExecute.
@Override
public void onExecute(String[] args) {
if (args.length == 0) {
Hyperium.INSTANCE.getHandlers().getGeneralChatHandler().sendMessage("Please input the command to disable");
return;
}
String command = args[0];
if (command.equalsIgnoreCase("disablecommand") || command.equalsIgnoreCase("hyperium")) {
Hyperium.INSTANCE.getHandlers().getGeneralChatHandler().sendMessage("That command cannot be disabled!");
return;
}
// True if the command is disabled, false if it is not
boolean disabled = handler.addOrRemoveCommand(args[0]);
ChatColor color = disabled ? ChatColor.RED : ChatColor.GREEN;
Hyperium.INSTANCE.getHandlers().getGeneralChatHandler().sendMessage("Command '" + args[0] + "' is " + color + (disabled ? "now" : "no longer") + ChatColor.WHITE + " disabled!");
handler.saveDisabledCommands();
}
Aggregations