aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/cowtipper/cowlection/command/MooCommand.java
diff options
context:
space:
mode:
authorCow <cow@volloeko.de>2020-12-20 15:12:34 +0100
committerCow <cow@volloeko.de>2020-12-20 15:12:34 +0100
commit609758ab51a46e4ccac2cd37f449f3682bc15770 (patch)
tree65c8bb2728b2356348129fd96478b630fcb10ba3 /src/main/java/de/cowtipper/cowlection/command/MooCommand.java
parent61b01b39496dd56e8bdce8b9c25d591af116dfec (diff)
downloadCowlection-609758ab51a46e4ccac2cd37f449f3682bc15770.tar.gz
Cowlection-609758ab51a46e4ccac2cd37f449f3682bc15770.tar.bz2
Cowlection-609758ab51a46e4ccac2cd37f449f3682bc15770.zip
Added config options to enable/disable some features
Diffstat (limited to 'src/main/java/de/cowtipper/cowlection/command/MooCommand.java')
-rw-r--r--src/main/java/de/cowtipper/cowlection/command/MooCommand.java12
1 files changed, 8 insertions, 4 deletions
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<String> 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." : ""));
}
}