Class TimeComponent

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

public class TimeComponent
extends com.zachsthings.libcomponents.bukkit.BukkitComponent
implements org.bukkit.event.Listener
TimeComponent contains commands and functions related to time management. These include
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Class Description
    class  TimeComponent.Commands  
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected com.sk89q.commandbook.component.time.TimeComponent.LocalConfiguration config
    This Component's configuration
    protected java.util.Map<java.lang.String,​java.lang.Integer> lockedTimes
    A Map of world names to time values.
    protected java.util.Map<java.lang.String,​java.lang.Integer> tasks
    A Map of time locker tasks for worlds.

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

    commands
  • Constructor Summary

    Constructors 
    Constructor Description
    TimeComponent()  
  • Method Summary

    Modifier and Type Method Description
    void enable()  
    java.util.Map<java.lang.String,​java.lang.Integer> getLockedTimes()
    Get locked times.
    void lock​(org.bukkit.World world)  
    static int matchTime​(java.lang.String timeStr)
    Deprecated.
    void onWorldLoad​(org.bukkit.event.world.WorldLoadEvent event)
    Called when a World is loaded.
    void onWorldUnload​(org.bukkit.event.world.WorldUnloadEvent event)  
    void reload()  
    void unlock​(org.bukkit.World world)  

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

    disable, 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
  • Field Details

    • tasks

      protected final java.util.Map<java.lang.String,​java.lang.Integer> tasks
      A Map of time locker tasks for worlds.
    • lockedTimes

      protected final java.util.Map<java.lang.String,​java.lang.Integer> lockedTimes
      A Map of world names to time values.
    • config

      protected com.sk89q.commandbook.component.time.TimeComponent.LocalConfiguration config
      This Component's configuration
  • 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
    • onWorldLoad

      public void onWorldLoad​(org.bukkit.event.world.WorldLoadEvent event)
      Called when a World is loaded.
    • onWorldUnload

      public void onWorldUnload​(org.bukkit.event.world.WorldUnloadEvent event)
    • getLockedTimes

      public java.util.Map<java.lang.String,​java.lang.Integer> getLockedTimes()
      Get locked times.
      Returns:
    • unlock

      public void unlock​(org.bukkit.World world)
    • lock

      public void lock​(org.bukkit.World world)
    • matchTime

      @Deprecated public static int matchTime​(java.lang.String timeStr) throws com.sk89q.minecraft.util.commands.CommandException
      Deprecated.
      Parse a time string.
      Parameters:
      timeStr -
      Returns:
      Throws:
      com.sk89q.minecraft.util.commands.CommandException