mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2025-02-27 09:42:26 +01:00
Added loops for the subcommands and more to the todo
This commit is contained in:
parent
b3febeb684
commit
fe7d7cf8f0
2
TODO.md
2
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
|
||||
|
@ -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<String> 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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user