- 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
+8 -9

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@
<groupId>com.palmergames.bukkit</groupId> <groupId>com.palmergames.bukkit</groupId>
<artifactId>TownyChat</artifactId> <artifactId>TownyChat</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>0.95</version> <version>0.96</version>
<licenses> <licenses>
<license> <license>
+2
View File
@@ -400,3 +400,5 @@ v0.94:
- Switch to using Translatables, so messages appear in the correct Locale for each player. - Switch to using Translatables, so messages appear in the correct Locale for each player.
v0.95: 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) { 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.. // So they just type /channel , We should probably send them to the help menu..
for (String line : channel_help) { if (split.length == 0 || split[0].equalsIgnoreCase("help") || split[0].equalsIgnoreCase("?")) {
for (String line : channel_help)
player.sendMessage(line); 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.) } else if (split[0].equalsIgnoreCase("join")) { // /channel join [chn] (/label args[0] args[1] length = 2.)
parseChannelJoin(player, StringMgmt.remFirstArg(split)); parseChannelJoin(player, StringMgmt.remFirstArg(split));
} else if (split[0].equalsIgnoreCase("leave")) { } else if (split[0].equalsIgnoreCase("leave")) {
@@ -110,8 +106,9 @@ public class ChannelCommand extends BaseCommand implements CommandExecutor {
parseChannelList(player); parseChannelList(player);
} else if (split[0].equalsIgnoreCase("soundtoggle")) { } else if (split[0].equalsIgnoreCase("soundtoggle")) {
parseChannelSoundToggle(player, StringMgmt.remFirstArg(split)); parseChannelSoundToggle(player, StringMgmt.remFirstArg(split));
} else {
TownyMessaging.sendErrorMsg(player, Translatable.of("msg_err_invalid_sub"));
} }
} }
public static void parseChannelList(Player player) { public static void parseChannelList(Player player) {