add protocol debug command

This commit is contained in:
ajgeiss0702
2022-01-13 15:27:01 -07:00
parent 271be6e198
commit 59da488eaa
2 changed files with 64 additions and 4 deletions
@@ -21,15 +21,19 @@ public class ManageCommand extends BaseCommand {
public ManageCommand(QueueMain main) {
this.main = main;
addSubCommand(new Reload(main));
//debug commands
addSubCommand(new Protocol(main));
addSubCommand(new ISP(main));
addSubCommand(new PermissionList(main));
addSubCommand(new Tasks(main));
addSubCommand(new Version(main));
addSubCommand(new Whitelist(main));
//normal commands
addSubCommand(new Reload(main));
addSubCommand(new Pause(main));
addSubCommand(new ISP(main));
addSubCommand(new QueueList(main));
addSubCommand(new Send(main));
addSubCommand(new PermissionList(main));
addSubCommand(new Whitelist(main));
addSubCommand(new Update(main));
addSubCommand(new Kick(main));
addSubCommand(new KickAll(main));
@@ -0,0 +1,56 @@
package us.ajg0702.queue.commands.commands.manage.debug;
import com.google.common.collect.ImmutableList;
import net.kyori.adventure.text.Component;
import us.ajg0702.queue.api.commands.ICommandSender;
import us.ajg0702.queue.commands.SubCommand;
import us.ajg0702.queue.common.QueueMain;
import us.ajg0702.utils.common.Messages;
import java.util.ArrayList;
import java.util.List;
public class Protocol extends SubCommand {
final QueueMain main;
public Protocol(QueueMain main) {
this.main = main;
}
@Override
public String getName() {
return "protocol";
}
@Override
public ImmutableList<String> getAliases() {
return ImmutableList.of();
}
@Override
public boolean showInTabComplete() {
return false;
}
@Override
public String getPermission() {
return null;
}
@Override
public Messages getMessages() {
return main.getMessages();
}
@Override
public void execute(ICommandSender sender, String[] args) {
if(!checkPermission(sender)) return;
if(!sender.isPlayer()) return;
sender.sendMessage(Component.text(main.getPlatformMethods().senderToPlayer(sender).getProtocolVersion()));
}
@Override
public List<String> autoComplete(ICommandSender sender, String[] args) {
return new ArrayList<>();
}
}