mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2024-11-25 12:06:17 +01:00
Made tab complete only show commands with permission
This commit is contained in:
parent
a762b58663
commit
829ba9bdd4
@ -110,7 +110,16 @@ public class CommandWithSubCommands implements CommandTemplate {
|
||||
}
|
||||
}
|
||||
else {
|
||||
return this.subCommandRegistry.getSubCommands();
|
||||
List<String> allowedCommands = new ArrayList<>();
|
||||
for (String subCommandName : this.subCommandRegistry.getSubCommands()) {
|
||||
if (subCommandName.equalsIgnoreCase(args[0])) {
|
||||
SubCommand subCommand = this.getSubCommand(subCommandName);
|
||||
if(subCommand.hasPermission(sender)) {
|
||||
allowedCommands.add(subCommandName);
|
||||
}
|
||||
}
|
||||
}
|
||||
return allowedCommands;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user