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 TypeMethodDescriptionvoid
disableTicker
(UUID uuid) This method disables the ticker at the givenUUID
and removes it from our internal "queue".void
disableTicker
(org.bukkit.Location l) This method disables the ticker at the givenLocation
and removes it from our internal "queue".void
enableTicker
(org.bukkit.Location l) This enables the ticker at the givenLocation
and adds it to our "queue".void
enableTicker
(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) int
This returns the delay between ticksvoid
halt()
boolean
isHalted()
void
run()
void
This method starts theTickerTask
on an asynchronous schedule.
-
Constructor Details
-
TickerTask
public TickerTask()
-
-
Method Details
-
start
This method starts theTickerTask
on 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
Map
representation of all tickingLocations
-
getTickLocations
@Nonnull public Map<io.github.bakedlibs.dough.blocks.ChunkPosition,Set<TickLocation>> getTickLocations() -
getLocations
This method returns a read-onlySet
of all tickingLocations
in a givenChunk
. TheChunk
does not have to be loaded. If noLocation
is present, the returnedSet
will be empty.- Parameters:
chunk
- TheChunk
- Returns:
- A
Set
of all tickingLocations
-
getTickLocations
返回一个给定区块下的 只读 的Map
代表每个ChunkPosition
中有UniversalBlock
属性的物品 Tick 的位置
集合. 其中包含的Location
可以是已加载或卸载的Chunk
-
enableTicker
public void enableTicker(@Nonnull org.bukkit.Location l) This enables the ticker at the givenLocation
and adds it to our "queue".- Parameters:
l
- TheLocation
to activate
-
enableTicker
-
disableTicker
public void disableTicker(@Nonnull org.bukkit.Location l) This method disables the ticker at the givenLocation
and removes it from our internal "queue".- Parameters:
l
- TheLocation
to remove
-
disableTicker
This method disables the ticker at the givenUUID
and removes it from our internal "queue". DO NOT USE THIS until you cannot disable by location, or enjoy extremely slow.- Parameters:
uuid
- TheUUID
to remove
-