aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/cowtipper/cowlection/command/MooCommand.java
diff options
context:
space:
mode:
authorCow <cow@volloeko.de>2020-08-06 18:01:42 +0200
committerCow <cow@volloeko.de>2020-08-06 18:01:42 +0200
commitba4dc3a0cbb58152c1fbdfe58224cb65685acc55 (patch)
tree7b516e171223640172b9e6b77de67f1bbb52cf9b /src/main/java/de/cowtipper/cowlection/command/MooCommand.java
parent2346e0ead0722f5fa9ce6e5bfda15ce927e3529a (diff)
downloadCowlection-ba4dc3a0cbb58152c1fbdfe58224cb65685acc55.tar.gz
Cowlection-ba4dc3a0cbb58152c1fbdfe58224cb65685acc55.tar.bz2
Cowlection-ba4dc3a0cbb58152c1fbdfe58224cb65685acc55.zip
Conflicts resolving
- Added keybinding to open chat with `/moo ` pre-typed - New sub-command: `/m cmd` to fix command conflicts with server-side commands with the same name `/m` - Added `/<command with tab-completable username> say` (similar to `/moo say`)
Diffstat (limited to 'src/main/java/de/cowtipper/cowlection/command/MooCommand.java')
-rw-r--r--src/main/java/de/cowtipper/cowlection/command/MooCommand.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main/java/de/cowtipper/cowlection/command/MooCommand.java b/src/main/java/de/cowtipper/cowlection/command/MooCommand.java
index 0c784eb..6be1a6c 100644
--- a/src/main/java/de/cowtipper/cowlection/command/MooCommand.java
+++ b/src/main/java/de/cowtipper/cowlection/command/MooCommand.java
@@ -140,9 +140,18 @@ public class MooCommand extends CommandBase {
else if (args[0].equalsIgnoreCase("help")) {
sendCommandUsage(sender);
}
+ // fix: run server-side command /m with optional arguments
+ else if (args[0].equalsIgnoreCase("cmd") || args[0].equalsIgnoreCase("command")) {
+ String cmdArgs = CommandBase.buildString(args, 1);
+ if (cmdArgs.length() > 0) {
+ cmdArgs = " " + cmdArgs;
+ }
+ Minecraft.getMinecraft().thePlayer.sendChatMessage("/m" + 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.");
+ 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.");
}
}