Allow disabling of queue command cooldown system
This commit is contained in:
@@ -62,13 +62,17 @@ public class QueueCommand extends BaseCommand {
|
|||||||
}
|
}
|
||||||
AdaptedPlayer player = main.getPlatformMethods().senderToPlayer(sender);
|
AdaptedPlayer player = main.getPlatformMethods().senderToPlayer(sender);
|
||||||
|
|
||||||
|
double cooldownTime = main.getConfig().getDouble("queue-command-cooldown");
|
||||||
|
|
||||||
|
if(cooldownTime > 0) {
|
||||||
long lastUse = cooldowns.getOrDefault(player, 0L);
|
long lastUse = cooldowns.getOrDefault(player, 0L);
|
||||||
if(System.currentTimeMillis() - lastUse < main.getConfig().getDouble("queue-command-cooldown") * 1000L) {
|
if(System.currentTimeMillis() - lastUse < cooldownTime * 1000L) {
|
||||||
sender.sendMessage(main.getMessages().getComponent("errors.too-fast-queue"));
|
sender.sendMessage(main.getMessages().getComponent("errors.too-fast-queue"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
cooldowns.put(player, System.currentTimeMillis());
|
cooldowns.put(player, System.currentTimeMillis());
|
||||||
|
}
|
||||||
|
|
||||||
if(args.length > 0) {
|
if(args.length > 0) {
|
||||||
if(main.getConfig().getBoolean("require-permission") && !player.hasPermission("ajqueue.queue."+args[0])) {
|
if(main.getConfig().getBoolean("require-permission") && !player.hasPermission("ajqueue.queue."+args[0])) {
|
||||||
|
|||||||
@@ -314,6 +314,8 @@ give-fulljoin-players-priority: 0
|
|||||||
force-queue-server-target: true
|
force-queue-server-target: true
|
||||||
|
|
||||||
# How long should the cooldown for queue commands be? (in seconds)
|
# How long should the cooldown for queue commands be? (in seconds)
|
||||||
|
# Set to -1 to disable
|
||||||
|
# Default: 3
|
||||||
queue-command-cooldown: 3
|
queue-command-cooldown: 3
|
||||||
|
|
||||||
# Should any server switch (including the initial join) count against the queue command cooldown?
|
# Should any server switch (including the initial join) count against the queue command cooldown?
|
||||||
|
|||||||
Reference in New Issue
Block a user