mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2024-12-24 01:48:07 +01:00
fix: show page numbers on tab complete
This commit is contained in:
parent
2cd64528a4
commit
b2e19a1391
@ -117,6 +117,10 @@ public class CommandWithSubCommands implements CommandTemplate {
|
||||
if(args.length > 1) {
|
||||
if(args[0].equalsIgnoreCase("help")) {
|
||||
List<String> allowedCommands = new ArrayList<>(this.subCommandRegistry.getSubCommands());
|
||||
int pages = (int) Math.ceil(allowedCommands.size() / (float) this.subCommandsPerPage);
|
||||
for (int i = 1; i <= pages; i++) {
|
||||
allowedCommands.add(String.valueOf(i));
|
||||
}
|
||||
Collections.sort(allowedCommands);
|
||||
return this.filterTabResults(allowedCommands, args[args.length - 1]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user