diff --git a/TODO.md b/TODO.md index 33ae588..d5d8975 100644 --- a/TODO.md +++ b/TODO.md @@ -6,6 +6,8 @@ Tag registration system (Mostly done, just needs to be tested and implemented) Portal loading system +Portal trigger system + Configs for language files to allow all messages to change Destination Command diff --git a/src/com/sekwah/advancedportals/core/commands/CommandWithSubCommands.java b/src/com/sekwah/advancedportals/core/commands/CommandWithSubCommands.java index 0a556e1..0755ebe 100644 --- a/src/com/sekwah/advancedportals/core/commands/CommandWithSubCommands.java +++ b/src/com/sekwah/advancedportals/core/commands/CommandWithSubCommands.java @@ -37,10 +37,15 @@ public class CommandWithSubCommands implements CommandTemplate { public void onCommand(CommandSenderContainer sender, String commandExecuted, String[] args) { if(args.length > 0) { if(args[0].equalsIgnoreCase("help")) { - // TODO do help menu here sorted alphabetically + // TODO start making a help menu } else { - + for(String subCommand : this.subCommandRegistry.getSubCommands()) { + if(subCommand.equalsIgnoreCase(args[0])) { + this.getSubCommand(subCommand).onCommand(sender, args); + return; + } + } } } else { @@ -50,6 +55,13 @@ public class CommandWithSubCommands implements CommandTemplate { @Override public List onTabComplete(CommandSenderContainer sender, String[] args) { + if(args.length > 0) { + for (String subCommand : this.subCommandRegistry.getSubCommands()) { + if (subCommand.equalsIgnoreCase(args[0])) { + return this.getSubCommand(subCommand).onTabComplete(sender, args); + } + } + } return null; } }