public class AnnoyingCooldown
extends xyz.srnyx.javautilities.parents.Stringable
CooldownManager.cooldowns| Modifier and Type | Field and Description |
|---|---|
@NotNull java.lang.String |
key
The key that "owns" this cooldown (example: a player's
UUID) |
@NotNull java.lang.String |
type
A string indicating the type of cooldown (examples:
command.play, use_ability, etc...) |
| Constructor and Description |
|---|
AnnoyingCooldown(@NotNull AnnoyingPlugin plugin,
@NotNull java.lang.Object type,
@NotNull java.lang.String key)
Creates a new cooldown with the given type, key, and duration
|
AnnoyingCooldown(@NotNull CooldownManager manager,
@NotNull java.lang.Object type,
@NotNull java.lang.String key)
Creates a new cooldown with the given type, key, and duration
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(@Nullable java.lang.Object other)
|
long |
getRemaining()
A
long of the time remaining on the cooldown |
int |
hashCode()
|
boolean |
isOnCooldown()
Checks if the cooldown is still going
|
boolean |
isOnCooldownStart(long duration)
Checks if the cooldown is still going
If it isn't, it will start the cooldown |
boolean |
isOnCooldownStop()
Checks if the cooldown is still going
If it is, it will stop the cooldown |
void |
start(long duration)
Starts the cooldown
If the cooldown is already started, it will be restarted |
void |
stop()
Stops the cooldown
|
@NotNull public final @NotNull java.lang.String type
command.play, use_ability, etc...)@NotNull public final @NotNull java.lang.String key
UUID)public AnnoyingCooldown(@NotNull
@NotNull CooldownManager manager,
@NotNull
@NotNull java.lang.Object type,
@NotNull
@NotNull java.lang.String key)
public AnnoyingCooldown(@NotNull
@NotNull AnnoyingPlugin plugin,
@NotNull
@NotNull java.lang.Object type,
@NotNull
@NotNull java.lang.String key)
public long getRemaining()
long of the time remaining on the cooldownDurationFormatter.formatDuration(long, String, boolean)public boolean isOnCooldown()
public boolean isOnCooldownStart(long duration)
start the cooldownduration - the duration of the cooldown (in milliseconds)public boolean isOnCooldownStop()
stop the cooldownpublic void start(long duration)
duration - the duration of the cooldown (in milliseconds)public void stop()
public boolean equals(@Nullable
@Nullable java.lang.Object other)
equals in class java.lang.Objectother - the object to compare topublic int hashCode()
hashCode in class java.lang.Object