Class Tasks
java.lang.Object
dev.upcraft.sparkweave.api.scheduler.Tasks
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CompletableFuture<com.mojang.datafixers.util.Either<Success, ? extends Exception>> scheduleEphemeral(Runnable task, long delayTicks) Schedule a task to run on the server's main thread after a delay.static <T> CompletableFuture<com.mojang.datafixers.util.Either<T, ? extends Exception>> scheduleEphemeral(Callable<T> task, long delayTicks) Schedule a task to run on the server's main thread after a delay.scheduleEphemeralAtFixedRate(Runnable task, long delayTicks, long periodTicks) Schedule a task to run on the server's main thread after an initial delay, and then repeatedly after a fixed delay.static <T> Task<T> scheduleEphemeralAtFixedRate(Callable<T> task, long delayTicks, long periodTicks) Schedule a task to run on the server's main thread after an initial delay, and then repeatedly after a fixed delay.
-
Constructor Details
-
Tasks
public Tasks()
-
-
Method Details
-
scheduleEphemeral
public static <T> CompletableFuture<com.mojang.datafixers.util.Either<T,? extends Exception>> scheduleEphemeral(Callable<T> task, long delayTicks) Schedule a task to run on the server's main thread after a delay. The task will not be saved to disk, and will not be run if the server restarts. -
scheduleEphemeralAtFixedRate
public static <T> Task<T> scheduleEphemeralAtFixedRate(Callable<T> task, long delayTicks, long periodTicks) Schedule a task to run on the server's main thread after an initial delay, and then repeatedly after a fixed delay. The task will not be saved to disk, and will not be run if the server restarts. -
scheduleEphemeral
public static CompletableFuture<com.mojang.datafixers.util.Either<Success,? extends Exception>> scheduleEphemeral(Runnable task, long delayTicks) Schedule a task to run on the server's main thread after a delay. The task will not be saved to disk, and will not be run if the server restarts. -
scheduleEphemeralAtFixedRate
public static Task<Success> scheduleEphemeralAtFixedRate(Runnable task, long delayTicks, long periodTicks) Schedule a task to run on the server's main thread after an initial delay, and then repeatedly after a fixed delay. The task will not be saved to disk, and will not be run if the server restarts.
-