diff --git a/src/main/java/com/songoda/epicvouchers/voucher/CoolDownManager.java b/src/main/java/com/songoda/epicvouchers/voucher/CoolDownManager.java index 60e61b1..92c8bdb 100644 --- a/src/main/java/com/songoda/epicvouchers/voucher/CoolDownManager.java +++ b/src/main/java/com/songoda/epicvouchers/voucher/CoolDownManager.java @@ -28,11 +28,14 @@ public class CoolDownManager { } public boolean isOnCoolDown(UUID uuid) { - if(!entries.containsKey(uuid)) { + + Long time = entries.get(uuid); + + if (time == null) { return false; } - if(entries.get(uuid) >= System.currentTimeMillis()) { + if (time >= System.currentTimeMillis()) { return true; } @@ -41,10 +44,12 @@ public class CoolDownManager { } public long getTime(UUID uuid) { - if(!entries.containsKey(uuid)) { + final Long time = entries.get(uuid); + + if (time == null) { return 0L; } - return (entries.get(uuid) - System.currentTimeMillis()) / 1000; + return (time - System.currentTimeMillis()) / 1000; } } \ No newline at end of file