use of com.velocitypowered.api.scheduler.ScheduledTask in project ScreamingLib by ScreamingSandals.
the class VelocityTaskInitializer method cancel.
@Override
public void cancel(TaskerTask task) {
final ScheduledTask toCancel = task.getTaskObject();
toCancel.cancel();
}
use of com.velocitypowered.api.scheduler.ScheduledTask in project LuckPerms by lucko.
the class VelocitySchedulerAdapter method asyncRepeating.
@Override
public SchedulerTask asyncRepeating(Runnable task, long interval, TimeUnit unit) {
ScheduledTask t = this.bootstrap.getProxy().getScheduler().buildTask(this.bootstrap, task).delay((int) interval, unit).repeat((int) interval, unit).schedule();
this.tasks.add(t);
return t::cancel;
}
use of com.velocitypowered.api.scheduler.ScheduledTask in project LuckPerms by lucko.
the class VelocitySchedulerAdapter method asyncLater.
@Override
public SchedulerTask asyncLater(Runnable task, long delay, TimeUnit unit) {
ScheduledTask t = this.bootstrap.getProxy().getScheduler().buildTask(this.bootstrap, task).delay((int) delay, unit).schedule();
this.tasks.add(t);
return t::cancel;
}
use of com.velocitypowered.api.scheduler.ScheduledTask in project ADP-Core by AlessioDP.
the class ADPVelocityScheduler method scheduleAsyncRepeating.
@Override
public CancellableTask scheduleAsyncRepeating(@NotNull Runnable runnable, long delay, long period, TimeUnit unit) {
ADPVelocityBootstrap velocityPlugin = ((ADPVelocityBootstrap) plugin.getBootstrap());
// Use Velocity scheduler instead of mine
ScheduledTask future = velocityPlugin.getServer().getScheduler().buildTask(velocityPlugin, runnable).delay(delay, unit).repeat(period, unit).schedule();
return future::cancel;
}
use of com.velocitypowered.api.scheduler.ScheduledTask in project ADP-Core by AlessioDP.
the class ADPVelocityScheduler method scheduleAsyncLater.
@Override
public CancellableTask scheduleAsyncLater(@NotNull Runnable runnable, long delay, TimeUnit unit) {
ADPVelocityBootstrap velocityPlugin = ((ADPVelocityBootstrap) plugin.getBootstrap());
// Use Velocity scheduler instead of mine
ScheduledTask future = velocityPlugin.getServer().getScheduler().buildTask(velocityPlugin, runnable).delay(delay, unit).schedule();
return future::cancel;
}
Aggregations