Class SequenceBuilder<T,U>
java.lang.Object
com.blamejared.crafttweaker.api.util.sequence.SequenceBuilder<T,U>
A builder for
Sequence.- DocParam:
- this level.sequence()
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddTask(ISequenceTask<T, U> task) Adds a task to the sequence.run(BiConsumer<T, SequenceContext<T, U>> function) Runs the function as part of the sequence.Runs the function as part of the sequence.sleep(long ticks) Sleep (wait) for the given amount of ticks.sleepUntil(BiPredicate<T, SequenceContext<T, U>> condition) Sleeps until the given condition is met.sleepUntil(Predicate<T> condition) Sleeps until the given condition is met.start()Builds and starts the sequence.then(BiConsumer<T, SequenceContext<T, U>> function) Runs the function as part of the sequence.Runs the function as part of the sequence.
-
Constructor Details
-
SequenceBuilder
-
-
Method Details
-
addTask
Adds a task to the sequence.- Parameters:
task- The task to add.- Returns:
- This builder to chain calls.
- DocParam:
- task new SleepTask(20)
-
sleep
Sleep (wait) for the given amount of ticks.- Parameters:
ticks- The amount of ticks to wait.- Returns:
- This builder to chain calls.
- DocParam:
- ticks 20
-
sleepUntil
Sleeps until the given condition is met.- Parameters:
condition- The condition to wait for.- Returns:
- This builder to chain calls.
- DocParam:
- condition (level) => level.isRaining
-
sleepUntil
Sleeps until the given condition is met.- Parameters:
condition- The condition to wait for.- Returns:
- This builder to chain calls.
- DocParam:
- condition (level, context) => level.isRaining
-
run
Runs the function as part of the sequence.- Parameters:
function- The function to run.- Returns:
- This builder to chain calls.
- DocParam:
- function (level) => level.setRainLevel(0.5)
-
run
Runs the function as part of the sequence.- Parameters:
function- The function to run.- Returns:
- This builder to chain calls.
- DocParam:
- function (level, context) => level.setRainLevel(0.5)
-
then
Runs the function as part of the sequence.This method is an alias for
run- Parameters:
function- The function to run.- Returns:
- This builder to chain calls.
- DocParam:
- function (level) => level.setRainLevel(0.5)
-
then
Runs the function as part of the sequence.This method is an alias for
run- Parameters:
function- The function to run.- Returns:
- This builder to chain calls.
- DocParam:
- function (level, context) => level.setRainLevel(0.5)
-
start
Builds and starts the sequence.- Returns:
- The sequence that was built.
-