mirror of
https://github.com/rockyhawk64/CommandPanels.git
synced 2025-11-18 07:14:17 +01:00
simplify and sort tab complete panel list
This commit is contained in:
parent
01c242ac3b
commit
ba489b1128
@ -45,16 +45,12 @@ public class TabComplete {
|
||||
|
||||
if (args.length == 2) {
|
||||
if (args[0].equalsIgnoreCase("open") && sender.hasPermission("commandpanels.command.open")) {
|
||||
if (sender instanceof Player player) {
|
||||
String prefix = args[1].toLowerCase();
|
||||
for (String panelName : ctx.plugin.panels.keySet()) {
|
||||
Panel panel = ctx.plugin.panels.get(panelName);
|
||||
if (panel.passesConditions(player, ctx)) {
|
||||
if (panelName.toLowerCase().contains(prefix)) {
|
||||
output.add(panelName);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
output.addAll(ctx.plugin.panels.keySet());
|
||||
}
|
||||
} else if (args[0].equalsIgnoreCase("data") && sender.hasPermission("commandpanels.command.data")) {
|
||||
output.addAll(Arrays.asList("get", "set", "overwrite", "math", "del", "clear"));
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user