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

public abstract class CooldownSimpleTrait extends SimpleTrait
A CooldownSimpleTrait is an SimpleTrait that provides the tools to program in a cooldown.
  • 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