Class TickerTask
java.lang.Object
io.github.thebusybiscuit.slimefun4.implementation.tasks.TickerTask
- All Implemented Interfaces:
Runnable
The
TickerTask is responsible for ticking every BlockTicker,
synchronous or not.- Author:
- TheBusyBiscuit
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddisableTicker(UUID uuid) This method disables the ticker at the givenUUIDand removes it from our internal "queue".voiddisableTicker(org.bukkit.Location l) This method disables the ticker at the givenLocationand removes it from our internal "queue".voidenableTicker(org.bukkit.Location l) This enables the ticker at the givenLocationand adds it to our "queue".voidenableTicker(org.bukkit.Location l, UUID uuid) BINARY COMPATIBILITY Use #getTickLocations insteadSet<org.bukkit.Location> getLocations(org.bukkit.Chunk chunk) Map<io.github.bakedlibs.dough.blocks.ChunkPosition, Set<TickLocation>> getTickLocations(org.bukkit.Chunk chunk) intThis returns the delay between ticksvoidhalt()booleanisHalted()voidrun()voidThis method starts theTickerTaskon an asynchronous schedule.
-
Constructor Details
-
TickerTask
public TickerTask()
-
-
Method Details
-
start
This method starts theTickerTaskon an asynchronous schedule.- Parameters:
plugin- The instance of ourSlimefun
-
run
public void run() -
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
Maprepresentation of all tickingLocations
-
getTickLocations
@Nonnull public Map<io.github.bakedlibs.dough.blocks.ChunkPosition,Set<TickLocation>> getTickLocations() -
getLocations
This method returns a read-onlySetof all tickingLocationsin a givenChunk. TheChunkdoes not have to be loaded. If noLocationis present, the returnedSetwill be empty.- Parameters:
chunk- TheChunk- Returns:
- A
Setof all tickingLocations
-
getTickLocations
返回一个给定区块下的 只读 的Map代表每个ChunkPosition中有UniversalBlock属性的物品 Tick 的位置集合. 其中包含的Location可以是已加载或卸载的Chunk -
enableTicker
public void enableTicker(@Nonnull org.bukkit.Location l) This enables the ticker at the givenLocationand adds it to our "queue".- Parameters:
l- TheLocationto activate
-
enableTicker
-
disableTicker
public void disableTicker(@Nonnull org.bukkit.Location l) This method disables the ticker at the givenLocationand removes it from our internal "queue".- Parameters:
l- TheLocationto remove
-
disableTicker
This method disables the ticker at the givenUUIDand removes it from our internal "queue". DO NOT USE THIS until you cannot disable by location, or enjoy extremely slow.- Parameters:
uuid- TheUUIDto remove
-