From 609758ab51a46e4ccac2cd37f449f3682bc15770 Mon Sep 17 00:00:00 2001 From: Cow Date: Sun, 20 Dec 2020 15:12:34 +0100 Subject: Added config options to enable/disable some features --- .../java/de/cowtipper/cowlection/command/MooCommand.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/main/java/de/cowtipper/cowlection/command') diff --git a/src/main/java/de/cowtipper/cowlection/command/MooCommand.java b/src/main/java/de/cowtipper/cowlection/command/MooCommand.java index d9ed787..d2f433d 100644 --- a/src/main/java/de/cowtipper/cowlection/command/MooCommand.java +++ b/src/main/java/de/cowtipper/cowlection/command/MooCommand.java @@ -51,7 +51,11 @@ public class MooCommand extends CommandBase { @Override public List getCommandAliases() { - return Collections.singletonList("m"); + if (StringUtils.isEmpty(MooConfig.mooCmdAlias)) { + return Collections.emptyList(); + } else { + return Collections.singletonList(MooConfig.mooCmdAlias); + } } @Override @@ -145,12 +149,12 @@ public class MooCommand extends CommandBase { if (cmdArgs.length() > 0) { cmdArgs = " " + cmdArgs; } - Minecraft.getMinecraft().thePlayer.sendChatMessage("/m" + cmdArgs); + Minecraft.getMinecraft().thePlayer.sendChatMessage("/" + MooConfig.mooCmdAlias + cmdArgs); } // "catch-all" remaining sub-commands else { - main.getChatHelper().sendMessage(EnumChatFormatting.RED, "Command " + EnumChatFormatting.DARK_RED + "/" + getCommandName() + " " + args[0] + EnumChatFormatting.RED + " doesn't exist. Use " + EnumChatFormatting.DARK_RED + "/" + getCommandName() + " help " + EnumChatFormatting.RED + "to show command usage.\n" - + EnumChatFormatting.RED + "Are you trying to use a server-side command " + EnumChatFormatting.DARK_RED + "/m" + EnumChatFormatting.RED + "? Use " + EnumChatFormatting.DARK_RED + "/m cmd [arguments] " + EnumChatFormatting.RED + "instead."); + main.getChatHelper().sendMessage(EnumChatFormatting.RED, "Command " + EnumChatFormatting.DARK_RED + "/" + getCommandName() + " " + args[0] + EnumChatFormatting.RED + " doesn't exist. Use " + EnumChatFormatting.DARK_RED + "/" + getCommandName() + " help " + EnumChatFormatting.RED + "to show command usage." + + (StringUtils.isNotEmpty(MooConfig.mooCmdAlias) ? "\n" + EnumChatFormatting.RED + "Are you trying to use a server-side command " + EnumChatFormatting.DARK_RED + "/" + MooConfig.mooCmdAlias + EnumChatFormatting.RED + "? Use " + EnumChatFormatting.DARK_RED + "/" + MooConfig.mooCmdAlias + " cmd [arguments] " + EnumChatFormatting.RED + "instead." : "")); } } -- cgit