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 TypeMethodDescriptionvoidThis method disables the ticker at the givenLocationand removes it from our internal "queue".voidThis enables the ticker at the givenLocationand adds it to our "queue".getLocations(Chunk chunk) intThis returns the delay between ticksvoidhalt()booleanThis method checks if a givenLocationwill be deleted on the next tick.booleanisHalted()booleanThis method checks if the givenLocationhas been reserved by thisTickerTask.voidqueueDelete(Collection<Location> locations, boolean destroy) voidqueueDelete(Map<Location, Boolean> locations) voidqueueDelete(Location l, boolean destroy) voidvoidrun()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() -
queueMove
-
queueDelete
-
queueDelete
@ParametersAreNonnullByDefault public void queueDelete(Collection<Location> locations, boolean destroy) -
queueDelete
-
isOccupiedSoon
This method checks if the givenLocationhas been reserved by thisTickerTask. A reservedLocationdoes not currently hold any data but will be occupied upon the next tick. Checking this ensures that ourLocationdoes not get treated like a normalLocationas it is theoretically "moving". -
isDeletedSoon
This method checks if a givenLocationwill be deleted on the next tick. -
getTickRate
public int getTickRate()This returns the delay between ticks- Returns:
- The tick delay
-
getLocations
-
getLocations
-
enableTicker
This enables the ticker at the givenLocationand adds it to our "queue".- Parameters:
l- TheLocationto activate
-
disableTicker
This method disables the ticker at the givenLocationand removes it from our internal "queue".- Parameters:
l- TheLocationto remove
-