From 1c5ad276957896d9b52a5f0f23d51715f201be17 Mon Sep 17 00:00:00 2001 From: PikaMug <2267126+PikaMug@users.noreply.github.com> Date: Mon, 16 Nov 2020 02:02:59 -0500 Subject: [PATCH] Adjust shortened actions or conditions subcommand --- .../quests/listeners/CmdExecutor.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/main/src/main/java/me/blackvein/quests/listeners/CmdExecutor.java b/main/src/main/java/me/blackvein/quests/listeners/CmdExecutor.java index a36fc78ae..cceb56463 100644 --- a/main/src/main/java/me/blackvein/quests/listeners/CmdExecutor.java +++ b/main/src/main/java/me/blackvein/quests/listeners/CmdExecutor.java @@ -162,20 +162,27 @@ public class CmdExecutor implements CommandExecutor { return null; } if (cmd.equalsIgnoreCase("quests")) { - if (commands.containsKey(args[0].toLowerCase())) { - final int min = commands.get(args[0].toLowerCase()); + String subCmd = args[0].toLowerCase(); + if (subCmd.equals("action")) { + subCmd = "actions"; + } else if (subCmd.equals("condition")) { + subCmd = "conditions"; + } + if (commands.containsKey(subCmd)) { + final int min = commands.get(subCmd); if (args.length < min) { - return getQuestsCommandUsage(args[0]); + return getQuestsCommandUsage(subCmd); } else { return null; } } return ChatColor.YELLOW + Lang.get("questsUnknownCommand"); } else if (cmd.equalsIgnoreCase("questsadmin") || cmd.equalsIgnoreCase("questadmin")) { - if (adminCommands.containsKey(args[0].toLowerCase())) { - final int min = adminCommands.get(args[0].toLowerCase()); + final String subCmd = args[0].toLowerCase(); + if (adminCommands.containsKey(subCmd)) { + final int min = adminCommands.get(subCmd); if (args.length < min) { - return getQuestadminCommandUsage(args[0]); + return getQuestadminCommandUsage(subCmd); } else { return null; }