/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;
|
||||
|
||||
Reference in New Issue
Block a user