Package org.kingdoms.utils.cooldown
Class LazyCooldown
java.lang.Object
org.kingdoms.utils.cooldown.LazyCooldown
A simple cooldown system using
Cache.
Expired cooldowns will be automatically removed.-
Constructor Summary
ConstructorsConstructorDescriptionLazyCooldown(Object id, String name, long time) LazyCooldown(Object id, String name, long time, TimeUnit timeUnit) Starts a new cooldown for the given ID with the name. -
Method Summary
Modifier and TypeMethodDescriptionstatic LazyCooldowngetCooldown(Object id, String name) static longgetTimeLeft(Object id, String name) static booleanisInCooldown(Object id, String name) static LazyCooldown
-
Constructor Details
-
LazyCooldown
Starts a new cooldown for the given ID with the name.- Parameters:
id- the ID of the entity.name- the cooldown's name.time- the time in milliseconds.
-
LazyCooldown
-
-
Method Details
-
isInCooldown
-
stop
-
getCooldown
-
getTimeLeft
-