/queue command tab complete
This commit is contained in:
@@ -1,13 +1,16 @@
|
||||
package us.ajg0702.queue.commands;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.md_5.bungee.api.CommandSender;
|
||||
import net.md_5.bungee.api.connection.ProxiedPlayer;
|
||||
import net.md_5.bungee.api.plugin.Command;
|
||||
import net.md_5.bungee.api.plugin.TabExecutor;
|
||||
import us.ajg0702.queue.Main;
|
||||
import us.ajg0702.queue.Manager;
|
||||
import us.ajg0702.utils.bungee.BungeeMessages;
|
||||
|
||||
public class MoveCommand extends Command {
|
||||
public class MoveCommand extends Command implements TabExecutor {
|
||||
Main plugin;
|
||||
BungeeMessages msgs;
|
||||
public MoveCommand(Main pl) {
|
||||
@@ -39,4 +42,15 @@ public class MoveCommand extends Command {
|
||||
}*/
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Iterable<String> onTabComplete(CommandSender sender, String[] args) {
|
||||
if(!plugin.getConfig().getBoolean("tab-complete-queues")) {
|
||||
return new ArrayList<>();
|
||||
}
|
||||
if(args.length == 1) {
|
||||
return Manager.getInstance().getServerNames();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ public class Commands implements CommandExecutor {
|
||||
String srvname = args[0];
|
||||
|
||||
if(args.length > 1) {
|
||||
pl.getLogger().info("sending player to queue");
|
||||
pl.getLogger().info("Sending "+args[0]+" to queue");
|
||||
if(!sender.hasPermission("ajqueue.send")) {
|
||||
sender.sendMessage(color("&cYou do not have permission to do this!"));
|
||||
return true;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Dont touch this number please
|
||||
config-version: 14
|
||||
config-version: 15
|
||||
|
||||
# The time the server will wait between sending people in the queue
|
||||
# Default: 5
|
||||
@@ -118,3 +118,8 @@ joinfrom-server-permission: false
|
||||
# Format: "groupname:server1,server2,etc"
|
||||
server-groups:
|
||||
- "lobbys:lobby-1,lobby-2,lobby-3"
|
||||
|
||||
|
||||
# Should we allow tab-completing in the /queue command?
|
||||
# Default: true
|
||||
tab-complete-queues: true
|
||||
|
||||
Reference in New Issue
Block a user