Package io.github.djtpj.trait.traits
Class CooldownSimpleTrait
java.lang.Object
io.github.djtpj.trait.Trait
io.github.djtpj.trait.SimpleTrait
io.github.djtpj.trait.traits.CooldownSimpleTrait
- All Implemented Interfaces:
org.bukkit.event.Listener
- Direct Known Subclasses:
Intangibility
,SpatialJumper
A CooldownSimpleTrait is an SimpleTrait that provides the tools to program in a cooldown.
-
Nested Class Summary
Nested classes/interfaces inherited from class io.github.djtpj.trait.Trait
Trait.Type
-
Field Summary
Fields inherited from class io.github.djtpj.trait.Trait
icon, playerTraitMap, type
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
CooldownSimpleTrait
(long cooldownTicks) protected
CooldownSimpleTrait
(String name, String description, org.bukkit.ChatColor color, org.bukkit.Material material, Trait.Type type, long cooldownTicks) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
getCooldownReady
(org.bukkit.entity.Player player) Check if the player's cooldown is overprotected void
sendCooldownMessage
(org.bukkit.entity.Player player) Sends a standardized message to the player telling them that the cooldown is not finished.protected void
startCooldown
(org.bukkit.entity.Player player) Begin the cooldown for a specific player
-
Constructor Details
-
CooldownSimpleTrait
protected CooldownSimpleTrait(String name, String description, org.bukkit.ChatColor color, org.bukkit.Material material, Trait.Type type, long cooldownTicks) -
CooldownSimpleTrait
protected CooldownSimpleTrait(long cooldownTicks)
-
-
Method Details
-
startCooldown
protected void startCooldown(org.bukkit.entity.Player player) Begin the cooldown for a specific player- Parameters:
player
- the player to initiate the cooldown for
-
sendCooldownMessage
protected void sendCooldownMessage(org.bukkit.entity.Player player) Sends a standardized message to the player telling them that the cooldown is not finished.- Parameters:
player
- the player to send the message to
-
getCooldownReady
protected boolean getCooldownReady(org.bukkit.entity.Player player) Check if the player's cooldown is over- Parameters:
player
- the player to check- Returns:
- whether the cooldown has ended
-