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
|
@NotNull CooldownType |
type
The
CooldownType that was used to create this cooldown |
| Constructor and Description |
|---|
AnnoyingCooldown(@NotNull AnnoyingPlugin plugin,
@NotNull java.lang.String key,
@NotNull CooldownType type)
Creates a new cooldown with the given key and type
|
| 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()
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 isn't, it will stop the cooldown |
void |
start()
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 key
@NotNull public final @NotNull CooldownType type
CooldownType that was used to create this cooldownpublic AnnoyingCooldown(@NotNull
@NotNull AnnoyingPlugin plugin,
@NotNull
@NotNull java.lang.String key,
@NotNull
@NotNull CooldownType type)
public long getRemaining()
long of the time remaining on the cooldownDurationFormatter.formatDuration(long, String, boolean)public boolean isOnCooldown()
public boolean isOnCooldownStop()
stop the cooldownpublic boolean isOnCooldownStart()
start the cooldownpublic void start()
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