public interface Scheduler
Modifier and Type | Method and Description |
---|---|
static Scheduler |
getInstance() |
ScheduledTask |
runDelayed(Runnable task,
int delayTicks)
Run task after waiting given ticks
|
void |
runRepeating(Consumer<ScheduledTask> task,
int delayTicks,
int intervalTicks) |
default ScheduledTask |
runRepeating(Runnable task,
int intervalTicks) |
ScheduledTask |
runRepeating(Runnable task,
int delayTicks,
int intervalTicks)
Run the given task each given ticks, after waiting a delay
|
ScheduledTask |
runRepeating(Runnable task,
int intervalTicks,
@Nullable String name) |
ScheduledTask |
runRepeatingAsync(Runnable task,
Duration delay,
Duration interval,
@Nullable String name) |
void runRepeating(Consumer<ScheduledTask> task, int delayTicks, int intervalTicks)
ScheduledTask runRepeating(Runnable task, int delayTicks, int intervalTicks)
task
- task to rundelayTicks
- delay before starting taskintervalTicks
- ticks between each task runneddefault ScheduledTask runRepeating(Runnable task, int intervalTicks)
ScheduledTask runRepeating(Runnable task, int intervalTicks, @Nullable String name)
ScheduledTask runDelayed(Runnable task, int delayTicks)
task
- task to rundelayTicks
- ticks before running taskScheduledTask runRepeatingAsync(Runnable task, Duration delay, Duration interval, @Nullable String name)
static Scheduler getInstance()