Package me.lokka30.levelledmobs.misc
Class Cooldown
java.lang.Object
me.lokka30.levelledmobs.misc.Cooldown
This class is used to put cooldowns on certain actions, on certain in-game objects - e.g.
clicking entities or blocks.
For example, this is used in Debug Entity Damage to stop spam from clicking the same entity over and over. It is also used in the Spawner Info for the same reason: blocks unnecessary chat spam.
- Since:
- 3.1.2
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
doesCooldownBelongToIdentifier
(@NotNull String identifier) Checks if this cooldown belongs to something with a certain ID.boolean
hasCooldownExpired
(long requiredTimeInSeconds) Check if the cooldown's required time (seconds!) has surpassed since the starting point.
-
Constructor Details
-
Cooldown
-
-
Method Details
-
doesCooldownBelongToIdentifier
Checks if this cooldown belongs to something with a certain ID.- Parameters:
identifier
- ID to check if this cooldown has the same ID.- Returns:
- if the IDs match.
-
hasCooldownExpired
public boolean hasCooldownExpired(long requiredTimeInSeconds) Check if the cooldown's required time (seconds!) has surpassed since the starting point.- Parameters:
requiredTimeInSeconds
- how many seconds should the cooldown have lasted?- Returns:
- if the cooldown has expired.
-