fix require-permission not being respected in /<server> commands

This commit is contained in:
ajgeiss0702
2021-12-16 09:44:28 -07:00
parent e07fb4cc51
commit 8587f47d24
@@ -45,6 +45,10 @@ public class SlashServerCommand extends BaseCommand {
sender.sendMessage(getMessages().getComponent("errors.player-only")); sender.sendMessage(getMessages().getComponent("errors.player-only"));
return; return;
} }
if(main.getConfig().getBoolean("require-permission") && !sender.hasPermission("ajqueue.queue."+args[0])) {
sender.sendMessage(getMessages().getComponent("noperm"));
return;
}
main.getQueueManager().addToQueue(main.getPlatformMethods().senderToPlayer(sender), server); main.getQueueManager().addToQueue(main.getPlatformMethods().senderToPlayer(sender), server);
} }