Class Timeline.Builder

java.lang.Object
com.github.darksoulq.abyssallib.world.particle.timeline.Timeline.Builder
Enclosing class:
Timeline

public static class Timeline.Builder extends Object
Fluent builder for the Timeline class.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • duration

      public Timeline.Builder duration(long ticks)
      Sets the total duration of the timeline. Note: Adding a keyframe that exceeds this will automatically increase the duration.
      Parameters:
      ticks - The duration in ticks.
      Returns:
      This builder.
    • loop

      public Timeline.Builder loop(boolean loop)
      Sets whether the timeline should loop.
      Parameters:
      loop - True to loop, false to stop at the end.
      Returns:
      This builder.
    • add

      public Timeline.Builder add(long start, long duration, Transformer transformer)
      Adds a transformation segment to the timeline.
      Parameters:
      start - The tick at which the transformation should begin.
      duration - The number of ticks the transformation should remain active.
      transformer - The Transformer logic to apply.
      Returns:
      This builder.
    • build

      public Timeline build()
      Constructs the final Timeline instance.
      Returns:
      The configured Timeline.