diff --git a/common/src/main/java/us/ajg0702/queue/commands/commands/queue/QueueCommand.java b/common/src/main/java/us/ajg0702/queue/commands/commands/queue/QueueCommand.java index 7882641..0409689 100644 --- a/common/src/main/java/us/ajg0702/queue/commands/commands/queue/QueueCommand.java +++ b/common/src/main/java/us/ajg0702/queue/commands/commands/queue/QueueCommand.java @@ -62,13 +62,17 @@ public class QueueCommand extends BaseCommand { } AdaptedPlayer player = main.getPlatformMethods().senderToPlayer(sender); - long lastUse = cooldowns.getOrDefault(player, 0L); - if(System.currentTimeMillis() - lastUse < main.getConfig().getDouble("queue-command-cooldown") * 1000L) { - sender.sendMessage(main.getMessages().getComponent("errors.too-fast-queue")); - return; - } + double cooldownTime = main.getConfig().getDouble("queue-command-cooldown"); - cooldowns.put(player, System.currentTimeMillis()); + if(cooldownTime > 0) { + long lastUse = cooldowns.getOrDefault(player, 0L); + if(System.currentTimeMillis() - lastUse < cooldownTime * 1000L) { + sender.sendMessage(main.getMessages().getComponent("errors.too-fast-queue")); + return; + } + + cooldowns.put(player, System.currentTimeMillis()); + } if(args.length > 0) { if(main.getConfig().getBoolean("require-permission") && !player.hasPermission("ajqueue.queue."+args[0])) { diff --git a/common/src/main/resources/config.yml b/common/src/main/resources/config.yml index e74f6e3..74055e5 100644 --- a/common/src/main/resources/config.yml +++ b/common/src/main/resources/config.yml @@ -314,6 +314,8 @@ give-fulljoin-players-priority: 0 force-queue-server-target: true # How long should the cooldown for queue commands be? (in seconds) +# Set to -1 to disable +# Default: 3 queue-command-cooldown: 3 # Should any server switch (including the initial join) count against the queue command cooldown?