Class CooldownsComponent

java.lang.Object
com.zachsthings.libcomponents.AbstractComponent
com.zachsthings.libcomponents.bukkit.BukkitComponent
com.sk89q.commandbook.component.cooldowns.CooldownsComponent
All Implemented Interfaces:
java.lang.Runnable, org.bukkit.command.CommandExecutor, org.bukkit.event.Listener

public class CooldownsComponent
extends com.zachsthings.libcomponents.bukkit.BukkitComponent
implements org.bukkit.event.Listener, java.lang.Runnable
This component provides command warmups and cooldowns, measured in seconds, by using a repeating scheduler task that increases the value for each entry in each CooldownState by one each second if the value is less than the number of seconds specified in the configuration, removing the entry if the warmup/cooldown has been removed from the configuration
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    class  CooldownsComponent.Commands  
    class  CooldownsComponent.CooldownCommands  
    class  CooldownsComponent.WarmupCommands  
  • Field Summary

    Fields inherited from class com.zachsthings.libcomponents.bukkit.BukkitComponent

    commands
  • Constructor Summary

    Constructors 
    Constructor Description
    CooldownsComponent()  
  • Method Summary

    Modifier and Type Method Description
    boolean checkCooldown​(org.bukkit.command.CommandSender sender, java.lang.String command)  
    boolean checkWarmup​(org.bukkit.command.CommandSender sender, java.lang.String command)  
    void disable()  
    void enable()  
    void playerHandler​(org.bukkit.event.player.PlayerCommandPreprocessEvent event)  
    void reload()  
    void run()  

    Methods inherited from class com.zachsthings.libcomponents.bukkit.BukkitComponent

    getCommands, onCommand, registerCommands, setUp, unregisterCommands

    Methods inherited from class com.zachsthings.libcomponents.AbstractComponent

    configure, getComponentLoader, getInformation, getRawConfiguration, isEnabled, saveConfig, saveConfig, setUp

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • enable

      public void enable()
      Specified by:
      enable in class com.zachsthings.libcomponents.AbstractComponent
    • reload

      public void reload()
      Overrides:
      reload in class com.zachsthings.libcomponents.AbstractComponent
    • disable

      public void disable()
      Overrides:
      disable in class com.zachsthings.libcomponents.bukkit.BukkitComponent
    • run

      public void run()
      Specified by:
      run in interface java.lang.Runnable
    • playerHandler

      public void playerHandler​(org.bukkit.event.player.PlayerCommandPreprocessEvent event)
    • checkCooldown

      public boolean checkCooldown​(org.bukkit.command.CommandSender sender, java.lang.String command)
    • checkWarmup

      public boolean checkWarmup​(org.bukkit.command.CommandSender sender, java.lang.String command)