Skip to content

Commit

Permalink
Add act-like-no-permission-servers-dont-exist option
Browse files Browse the repository at this point in the history
  • Loading branch information
ajgeiss0702 committed May 12, 2024
1 parent 3e4672f commit 656f583
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,11 @@ public void execute(ICommandSender sender, String[] args) {

if(args.length > 0) {
if(main.getConfig().getBoolean("require-permission") && !player.hasPermission("ajqueue.queue."+args[0])) {
sender.sendMessage(getMessages().getComponent("noperm"));
sender.sendMessage(
main.getConfig().getBoolean("act-like-no-permission-servers-dont-exist") ?
getMessages().getComponent("errors.server-not-exist", "SERVER:"+args[0]) :
getMessages().getComponent("noperm")
);
return;
}
if(main.getConfig().getBoolean("joinfrom-server-permission") && !player.hasPermission("ajqueue.joinfrom."+player.getServerName())) {
Expand Down
8 changes: 8 additions & 0 deletions common/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,14 @@ message-time: 10
# Default: false
require-permission: false

# Should we act like servers a player doesn't have permission for doesn't exist?
# So if a player doesn't have permission to queue for a server, and they try to queue for it,
# ajQueue will send the server-not-exist message instead of the noperm message.
# This option does nothing if require-permission is disabled.
# IMO this is pointless, but people keep asking for it so here you go...
# Default: false
act-like-no-permission-servers-dont-exist: false

# Require a permission for players to be able to join a queue from a server.
# If enabled, players will need the permission ajqueue.joinfrom.<server> to join queues.
# Replace <server> with the name of the server
Expand Down

0 comments on commit 656f583

Please sign in to comment.