- Display invalid subcommand message when /ch is used with an invalid

subcommand.
This commit is contained in:
Llm Dl committed 2022-02-03 15:20:06 -06:00
1 parent 7d6cad6ddf
commit 0ca059d9fe
3 files changed
+9 -10

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@
<groupId>com.palmergames.bukkit</groupId>
<artifactId>TownyChat</artifactId>
<packaging>jar</packaging>
<version>0.95</version>
<version>0.96</version>
<licenses>
<license>
+3 -1
View File
@@ -399,4 +399,6 @@ v0.94:
- Remove 2 unused replacers in TownyChatFormatter.
- Switch to using Translatables, so messages appear in the correct Locale for each player.
v0.95:
- Regression: channels.yml not handling /townychat reload, bug began in 0.92.
- Regression: channels.yml not handling /townychat reload, bug began in 0.92.
v0.96:
- Display invalid subcommand message when /ch is used with an invalid subcommand.
@@ -88,14 +88,10 @@ public class ChannelCommand extends BaseCommand implements CommandExecutor {
}
private void parseChannelCommand(Player player, String[] split) {
if (split.length == 0) { // So they just type /channel , We should probably send them to the help menu..
for (String line : channel_help) {
// So they just type /channel , We should probably send them to the help menu..
if (split.length == 0 || split[0].equalsIgnoreCase("help") || split[0].equalsIgnoreCase("?")) {
for (String line : channel_help)
player.sendMessage(line);
}
} else if (split[0].equalsIgnoreCase("help") || split[0].equalsIgnoreCase("?")) {
for (String line : channel_help) {
player.sendMessage(line);
}
} else if (split[0].equalsIgnoreCase("join")) { // /channel join [chn] (/label args[0] args[1] length = 2.)
parseChannelJoin(player, StringMgmt.remFirstArg(split));
} else if (split[0].equalsIgnoreCase("leave")) {
@@ -110,8 +106,9 @@ public class ChannelCommand extends BaseCommand implements CommandExecutor {
parseChannelList(player);
} else if (split[0].equalsIgnoreCase("soundtoggle")) {
parseChannelSoundToggle(player, StringMgmt.remFirstArg(split));
} else {
TownyMessaging.sendErrorMsg(player, Translatable.of("msg_err_invalid_sub"));
}
}
public static void parseChannelList(Player player) {