Class Sequence<T>
java.lang.Object
dev.bouncingelf10.timelesslib.api.scheduler.Sequence<T>
A builder for a chain of delayed steps that run one after another - "wait, then do this, then wait, then do that".
Unlike nesting
Unlike nesting
after(...) calls inside each other, a sequence is a single cancellable/pausable
TaskHandle for the whole chain. Obtained through Scheduler.sequence() / Scheduler.sequence().-
Method Summary
Modifier and TypeMethodDescriptionstart()Starts the sequence.start(net.minecraft.resources.Identifier id) Starts the sequence under the given ID.Adds a step that runs the given delay after the previous step finishes, without needing the context.Adds a step that runs the given delay after the previous step finishes (or after the sequence starts, for the first step).
-
Method Details
-
then
-
then
-
start
Starts the sequence.- Returns:
TaskHandlefor the whole chain - cancelling it stops the sequence, pausing it pauses whichever step is currently pending.
-
start
Starts the sequence under the given ID.- Throws:
IllegalArgumentException- if a task with the specified ID already exists
-