Add debug for command cooldowns.

This commit is contained in:
Ali Moghnieh 2016-08-06 17:53:24 +01:00
parent 611429b6f6
commit 00301b26e6
No known key found for this signature in database
GPG Key ID: F09D3A1BAF2E6D70

View File

@ -451,6 +451,9 @@ public class EssentialsPlayerListener implements Listener {
Entry<Pattern, Long> cooldownEntry = ess.getSettings().getCommandCooldownEntry(fullCommand);
if (cooldownEntry != null) {
if (ess.getSettings().isDebug()) {
ess.getLogger().info("Applying " + cooldownEntry.getValue() + "ms cooldown on /" + fullCommand + " for" + user.getName() + ".");
}
Date expiry = new Date(System.currentTimeMillis() + cooldownEntry.getValue());
user.addCommandCooldown(cooldownEntry.getKey(), expiry, ess.getSettings().isCommandCooldownPersistent(fullCommand));
}