fix: switch tab complete to empty arrays from null returns

This commit is contained in:
Sekwah 2023-04-12 03:31:16 +01:00
parent ef9241e260
commit 9deb765ad5
2 changed files with 9 additions and 3 deletions

View File

@ -125,10 +125,16 @@ public class CommandWithSubCommands implements CommandTemplate {
if (subCommandName.equalsIgnoreCase(args[0])) {
SubCommand subCommand = this.getSubCommand(subCommandName);
if (subCommand.hasPermission(sender)) {
return this.filterTabResults(this.getSubCommand(subCommandName).onTabComplete(sender, args),
List<String> tabComplete = this.filterTabResults(this.getSubCommand(subCommandName).onTabComplete(sender, args),
args[args.length - 1]);
if(tabComplete != null) {
return tabComplete;
}
else {
return Collections.emptyList();
}
} else {
return null;
return Collections.emptyList();
}
}
}

View File

@ -36,7 +36,7 @@ command.reload.detailedhelp=Reloads all portal data from files in the data folde
command.reload.reloaded= All Advanced Portals data reloaded
command.create.help=Creates portals
command.create.error= There was an error making the portal:
command.create.error= There was a problem making the portal:
command.create.console= You cannot create a portal using the console.
command.create.detailedhelp=Format is /portal create (name) [tag:tagvalue] List tags after create in the format tag:value, if your value needs spaces use the format tag:"value with spaces"
command.create.complete= The portal has been successfully created.