mirror of
https://github.com/YouHaveTrouble/CommandWhitelist.git
synced 2026-05-12 14:36:56 +00:00
work on command completions
This commit is contained in:
+9
-1
@@ -11,6 +11,10 @@ import net.md_5.bungee.api.CommandSender;
|
||||
import net.md_5.bungee.api.plugin.Command;
|
||||
import net.md_5.bungee.api.plugin.TabExecutor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class BungeeMainCommand extends Command implements TabExecutor {
|
||||
|
||||
public BungeeMainCommand(String name) {
|
||||
@@ -77,6 +81,10 @@ public class BungeeMainCommand extends Command implements TabExecutor {
|
||||
|
||||
@Override
|
||||
public Iterable<String> onTabComplete(CommandSender sender, String[] args) {
|
||||
return null;
|
||||
List<String> serverCommands = new ArrayList<>();
|
||||
for (Map.Entry<String, Command> command : CommandWhitelistWaterfall.getPlugin().getProxy().getPluginManager().getCommands()) {
|
||||
serverCommands.add(command.getValue().getName());
|
||||
}
|
||||
return CWCommand.commandSuggestions(CommandWhitelistWaterfall.getConfigCache(), serverCommands, args, sender.hasPermission(CWPermission.RELOAD.permission()),sender.hasPermission(CWPermission.ADMIN.permission()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user