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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
This method disables the ticker at the givenLocation
and removes it from our internal "queue".void
This enables the ticker at the givenLocation
and adds it to our "queue".getLocations
(Chunk chunk) int
This returns the delay between ticksvoid
halt()
boolean
This method checks if a givenLocation
will be deleted on the next tick.boolean
isHalted()
boolean
This method checks if the givenLocation
has been reserved by thisTickerTask
.void
queueDelete
(Collection<Location> locations, boolean destroy) void
queueDelete
(Map<Location, Boolean> locations) void
queueDelete
(Location l, boolean destroy) void
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() -
queueMove
-
queueDelete
-
queueDelete
@ParametersAreNonnullByDefault public void queueDelete(Collection<Location> locations, boolean destroy) -
queueDelete
-
isOccupiedSoon
This method checks if the givenLocation
has been reserved by thisTickerTask
. A reservedLocation
does not currently hold any data but will be occupied upon the next tick. Checking this ensures that ourLocation
does not get treated like a normalLocation
as it is theoretically "moving". -
isDeletedSoon
This method checks if a givenLocation
will 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 givenLocation
and adds it to our "queue".- Parameters:
l
- TheLocation
to activate
-
disableTicker
This method disables the ticker at the givenLocation
and removes it from our internal "queue".- Parameters:
l
- TheLocation
to remove
-