java.lang.Object
io.github.thebusybiscuit.slimefun4.implementation.tasks.TickerTask
All Implemented Interfaces:
Runnable

public class TickerTask extends Object implements Runnable
The TickerTask is responsible for ticking every BlockTicker, synchronous or not.
Author:
TheBusyBiscuit
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    This method disables the ticker at the given UUID and removes it from our internal "queue".
    void
    disableTicker(org.bukkit.Location l)
    This method disables the ticker at the given Location and removes it from our internal "queue".
    void
    enableTicker(org.bukkit.Location l)
    This enables the ticker at the given Location and adds it to our "queue".
    void
    enableTicker(org.bukkit.Location l, UUID uuid)
     
    Map<io.github.bakedlibs.dough.blocks.ChunkPosition,Set<org.bukkit.Location>>
    BINARY COMPATIBILITY Use #getTickLocations instead
    Set<org.bukkit.Location>
    getLocations(org.bukkit.Chunk chunk)
    This method returns a read-only Set of all ticking Locations in a given Chunk.
    Map<io.github.bakedlibs.dough.blocks.ChunkPosition,Set<TickLocation>>
    This method returns a read-only Map representation of every ChunkPosition and its corresponding Set of ticking Locations.
    getTickLocations(org.bukkit.Chunk chunk)
    返回一个给定区块下的 只读Map 代表每个 ChunkPosition 中有 UniversalBlock 属性的物品 Tick 的 位置集合.
    int
    This returns the delay between ticks
    void
     
    boolean
     
    void
    run()
     
    void
    start(Slimefun plugin)
    This method starts the TickerTask on an asynchronous schedule.

    Methods inherited from class java.lang.Object

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

    • TickerTask

      public TickerTask()
  • Method Details

    • start

      public void start(@Nonnull Slimefun plugin)
      This method starts the TickerTask on an asynchronous schedule.
      Parameters:
      plugin - The instance of our Slimefun
    • run

      public void run()
      Specified by:
      run in interface Runnable
    • isHalted

      public boolean isHalted()
    • halt

      public void halt()
    • getTickRate

      public int getTickRate()
      This returns the delay between ticks
      Returns:
      The tick delay
    • getLocations

      @Nonnull public Map<io.github.bakedlibs.dough.blocks.ChunkPosition,Set<org.bukkit.Location>> getLocations()
      BINARY COMPATIBILITY Use #getTickLocations instead
      Returns:
      A Map representation of all ticking Locations
    • getTickLocations

      @Nonnull public Map<io.github.bakedlibs.dough.blocks.ChunkPosition,Set<TickLocation>> getTickLocations()
      This method returns a read-only Map representation of every ChunkPosition and its corresponding Set of ticking Locations. This does include any Location from an unloaded Chunk too!
      Returns:
      A Map representation of all ticking Locations
    • getLocations

      @Nonnull public Set<org.bukkit.Location> getLocations(@Nonnull org.bukkit.Chunk chunk)
      This method returns a read-only Set of all ticking Locations in a given Chunk. The Chunk does not have to be loaded. If no Location is present, the returned Set will be empty.
      Parameters:
      chunk - The Chunk
      Returns:
      A Set of all ticking Locations
    • getTickLocations

      @Nonnull public Set<TickLocation> getTickLocations(@Nonnull org.bukkit.Chunk chunk)
      返回一个给定区块下的 只读Map 代表每个 ChunkPosition 中有 UniversalBlock 属性的物品 Tick 的 位置集合. 其中包含的 Location 可以是已加载或卸载的 Chunk
      Parameters:
      chunk - Chunk
      Returns:
      包含所有机器 Tick 位置的只读 Map
    • enableTicker

      public void enableTicker(@Nonnull org.bukkit.Location l)
      This enables the ticker at the given Location and adds it to our "queue".
      Parameters:
      l - The Location to activate
    • enableTicker

      public void enableTicker(@Nonnull org.bukkit.Location l, @Nullable UUID uuid)
    • disableTicker

      public void disableTicker(@Nonnull org.bukkit.Location l)
      This method disables the ticker at the given Location and removes it from our internal "queue".
      Parameters:
      l - The Location to remove
    • disableTicker

      public void disableTicker(@Nonnull UUID uuid)
      This method disables the ticker at the given UUID and removes it from our internal "queue". DO NOT USE THIS until you cannot disable by location, or enjoy extremely slow.
      Parameters:
      uuid - The UUID to remove