Package foundry.veil.impl
Class TickTaskSchedulerImpl
java.lang.Object
foundry.veil.impl.TickTaskSchedulerImpl
- All Implemented Interfaces:
TickTaskScheduler
,Executor
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Executes the specified command on the next particle system tick.boolean
void
run()
Runs a single tick and executes all pending tasks for that time.Schedules the specified command to run in the specified number of ticks.<V> CompletableFuture
<V> Schedules the specified command to run in the specified number of ticks.scheduleAtFixedRate
(Runnable command, int initialDelay, int period) Schedules the specified command to run after the specified initial delay in ticks and at each fixed time interval in ticks.void
shutdown()
Stops the scheduler and runs all pending tasks as quickly as possible.
-
Constructor Details
-
TickTaskSchedulerImpl
public TickTaskSchedulerImpl()
-
-
Method Details
-
run
public void run()Runs a single tick and executes all pending tasks for that time. -
shutdown
public void shutdown()Stops the scheduler and runs all pending tasks as quickly as possible. -
execute
Description copied from interface:TickTaskScheduler
Executes the specified command on the next particle system tick.- Specified by:
execute
in interfaceExecutor
- Specified by:
execute
in interfaceTickTaskScheduler
- Parameters:
command
- The runnable task
-
schedule
Description copied from interface:TickTaskScheduler
Schedules the specified command to run in the specified number of ticks.- Specified by:
schedule
in interfaceTickTaskScheduler
- Parameters:
command
- The runnable taskdelay
- The delay in ticks- Returns:
- A future that completes after the task has been run
-
schedule
Description copied from interface:TickTaskScheduler
Schedules the specified command to run in the specified number of ticks.- Specified by:
schedule
in interfaceTickTaskScheduler
- Parameters:
callable
- The callable taskdelay
- The delay in ticks- Returns:
- A future that completes after the task has been run
-
scheduleAtFixedRate
Description copied from interface:TickTaskScheduler
Schedules the specified command to run after the specified initial delay in ticks and at each fixed time interval in ticks.- Specified by:
scheduleAtFixedRate
in interfaceTickTaskScheduler
- Parameters:
command
- The runnable taskinitialDelay
- The initial delay in ticksperiod
- The period between task executions- Returns:
- A future that completes if there was an error
-
isShutdown
public boolean isShutdown()- Specified by:
isShutdown
in interfaceTickTaskScheduler
- Returns:
- Whether the executor has shut down and will reject
-