Package com.Moshu.Misc
Class Cooldown
java.lang.Object
com.Moshu.Misc.Cooldown
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
error()
Sends an error message to the player.int
getDays()
int
getHours()
int
getName()
org.bukkit.entity.Player
static double
getRemainingTime
(UUID uuid, String kit) static int
getRemainingTimeMinutes
(UUID uuid, String name) static int
getRemainingTimeSeconds
(UUID uuid, String name) int
getUUID()
boolean
has()
Checks if the player has an active cooldown of this typestatic boolean
hasCooldown
(UUID uuid, String name) int
Get remaining timevoid
remove()
Removes the cooldown if the time ran upvoid
set()
Sets the cooldown as activestatic void
setCooldowns
(UUID uuid, String name, int seconds) This can be used for every case, while the old method works only for Kits.
-
Field Details
-
cooldowns
-
plugin
-
-
Constructor Details
-
Cooldown
-
Cooldown
Easily set cooldowns for anything- Parameters:
uuid
- , the player's uuidname
- , the cooldown's nameseconds
- , the time in seconds for the cooldown
-
-
Method Details
-
set
public void set()Sets the cooldown as active -
has
public boolean has()Checks if the player has an active cooldown of this type- Returns:
- true/false
-
remove
public void remove()Removes the cooldown if the time ran up -
getName
-
getPlayer
public org.bukkit.entity.Player getPlayer() -
getUUID
-
getSeconds
public int getSeconds() -
getMinutes
public int getMinutes() -
getHours
public int getHours() -
getDays
public int getDays() -
remainingTime
public int remainingTime()Get remaining time- Returns:
- remaining time in minutes
-
error
public void error()Sends an error message to the player. -
setCooldowns
This can be used for every case, while the old method works only for Kits.- Parameters:
uuid
- player's uuidname
- cooldown nameseconds
- the cooldown time in seconds
-
hasCooldown
- Parameters:
uuid
- the player's uuidname
- cooldown name- Returns:
- true if the player has a cooldown active and false if he doesn't
-
getRemainingTime
- Parameters:
uuid
- player's uuidkit
- the kit you want to get the cooldown of- Returns:
- the remaining cooldown in hours
-
getRemainingTimeMinutes
- Parameters:
uuid
- player's uuidname
- the cooldown you want to get the cooldown of- Returns:
- the remaining cooldown in minutes
-
getRemainingTimeSeconds
-