public class SchedulerUtils
extends java.lang.Object
限定符和类型 | 类和说明 |
---|---|
static interface |
SchedulerUtils.Task |
class |
SchedulerUtils.TaskBuilder |
构造器和说明 |
---|
SchedulerUtils(org.bukkit.plugin.java.JavaPlugin plugin) |
限定符和类型 | 方法和说明 |
---|---|
void |
repeat(int repetitions,
long interval,
java.lang.Runnable task,
java.lang.Runnable onComplete)
重复执行一个任务。
|
void |
repeatAsync(int repetitions,
long interval,
java.lang.Runnable task,
java.lang.Runnable onComplete)
重复执行一个任务。
|
void |
repeatWhile(long interval,
java.util.concurrent.Callable<java.lang.Boolean> predicate,
java.lang.Runnable task,
java.lang.Runnable onComplete)
在满足某个条件时,重复执行一个任务。
|
void |
repeatWhileAsync(long interval,
java.util.concurrent.Callable<java.lang.Boolean> predicate,
java.lang.Runnable task,
java.lang.Runnable onComplete)
在满足某个条件时,重复执行一个任务。
|
void |
run(java.lang.Runnable runnable)
在服务端主线程中执行一个任务
|
void |
runAsync(java.lang.Runnable runnable)
异步执行一个任务。
|
void |
runAtInterval(long delay,
long interval,
java.lang.Runnable... tasks)
间隔一段时间按顺序执行列表中的任务
|
void |
runAtInterval(long interval,
java.lang.Runnable... tasks)
间隔一段时间按顺序执行列表中的任务
|
void |
runAtIntervalAsync(long delay,
long interval,
java.lang.Runnable... tasks)
间隔一段时间按顺序异步执行列表中的任务
|
void |
runAtIntervalAsync(long interval,
java.lang.Runnable... tasks)
间隔一段时间按顺序异步执行列表中的任务
|
void |
runLater(long delay,
java.lang.Runnable runnable)
在主线程延时执行一个任务。
|
void |
runLaterAsync(long delay,
java.lang.Runnable runnable)
异步延时执行一个任务。
|
public void run(java.lang.Runnable runnable)
runnable
- 需要执行的任务public void runAsync(java.lang.Runnable runnable)
runnable
- 需要执行的任务public void runLater(long delay, java.lang.Runnable runnable)
delay
- 延迟的ticksrunnable
- 需要执行的任务public void runLaterAsync(long delay, java.lang.Runnable runnable)
delay
- 延迟的ticksrunnable
- 需要执行的任务public void runAtInterval(long interval, java.lang.Runnable... tasks)
interval
- 间隔时间tasks
- 任务列表public void runAtInterval(long delay, long interval, java.lang.Runnable... tasks)
delay
- 延迟时间interval
- 间隔时间tasks
- 任务列表public void runAtIntervalAsync(long interval, java.lang.Runnable... tasks)
interval
- 间隔时间tasks
- 任务列表public void runAtIntervalAsync(long delay, long interval, java.lang.Runnable... tasks)
delay
- 延迟时间interval
- 间隔时间tasks
- 任务列表public void repeat(int repetitions, long interval, java.lang.Runnable task, java.lang.Runnable onComplete)
repetitions
- 重复次数interval
- 间隔时间task
- 任务onComplete
- 结束时执行的任务public void repeatAsync(int repetitions, long interval, java.lang.Runnable task, java.lang.Runnable onComplete)
repetitions
- 重复次数interval
- 间隔时间task
- 任务onComplete
- 结束时执行的任务public void repeatWhile(long interval, java.util.concurrent.Callable<java.lang.Boolean> predicate, java.lang.Runnable task, java.lang.Runnable onComplete)
interval
- 重复间隔时间predicate
- 条件task
- 任务onComplete
- 结束时执行的任务public void repeatWhileAsync(long interval, java.util.concurrent.Callable<java.lang.Boolean> predicate, java.lang.Runnable task, java.lang.Runnable onComplete)
interval
- 重复间隔时间predicate
- 条件task
- 任务onComplete
- 结束时执行的任务Copyright © 2024. All rights reserved.