Class AbstractCooldownManager<T>
java.lang.Object
dev.bouncingelf10.timelesslib.api.countdown.CountdownManager<T>
dev.bouncingelf10.timelesslib.api.cooldown.AbstractCooldownManager<T>
- Direct Known Subclasses:
ClientCooldownManager,ServerCooldownManager
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractCooldownManager(Supplier<T> context) protectedAbstractCooldownManager(Supplier<T> context, int poolSize) -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if a cooldown is ready for the given owner and key.
Note: "Ready" means that the cooldown has finished.protected abstract UUIDnormalizeOwner(UUID owner) voidvoidYou should probably usereset(UUID, String)instead.Starts a cooldown for the given owner.startIfAbsent(UUID owner, String key, Duration duration, TimeSource timeSource) Starts a cooldown for the given owner if it does not exist yet.startRealtime(UUID owner, String key, Duration duration) Starts a realtime cooldown for the given owner.Methods inherited from class dev.bouncingelf10.timelesslib.api.countdown.CountdownManager
get, shutdown, shutdownGracefully, start, start, startRealtime
-
Constructor Details
-
AbstractCooldownManager
-
AbstractCooldownManager
-
-
Method Details
-
normalizeOwner
-
start
Starts a cooldown for the given owner.- Parameters:
owner- Owner of the cooldown.key- Cooldown key.duration- Cooldown duration.- Returns:
Countdown- See Also:
-
startRealtime
Starts a realtime cooldown for the given owner.- Parameters:
owner- Owner of the cooldown.key- Cooldown key.duration- Cooldown duration.- Returns:
Countdown- See Also:
-
startIfAbsent
Starts a cooldown for the given owner if it does not exist yet. If it does exist, it is returned instead.- Parameters:
owner- Owner of the cooldown.key- Cooldown key.duration- Cooldown duration.timeSource- Time source to use for the cooldown.- Returns:
Countdown- See Also:
-
isReady
Checks if a cooldown is ready for the given owner and key.
Note: "Ready" means that the cooldown has finished.- Parameters:
owner- Owner of the cooldown.key- Cooldown key.- Returns:
- true if the cooldown is ready, false otherwise.
-
remaining
-
reset
-
resetAll
You should probably usereset(UUID, String)instead. Especially if you're NOT using a custom CooldownManager.
-