Class AttributeTrack.Builder<V>

java.lang.Object
dev.wyck.level.dimension.timeline.AttributeTrack.Builder<V>
Type Parameters:
V - the type of the attribute
Enclosing interface:
AttributeTrack<V>

@AsOf("3.2.0") public static final class AttributeTrack.Builder<V> extends Object
Builder for AttributeTrack.
Since:
3.2.0
  • Constructor Details

    • Builder

      public Builder()
    • Builder

      public Builder(AttributeTrack<V> track)
  • Method Details

    • attribute

      @AsOf("3.2.0") public AttributeTrack.Builder<V> attribute(EnvironmentAttribute<?> attribute)
      Sets the attribute of the track.
      Parameters:
      attribute - the attribute of the track
      Returns:
      this builder
      Since:
      3.2.0
    • attribute

      @AsOf("3.2.0") public AttributeTrack.Builder<V> attribute(EnvironmentAttributeSupplier<?> attribute)
      Sets the attribute of the track.
      Parameters:
      attribute - the attribute of the track
      Returns:
      this builder
      Since:
      3.2.0
    • operation

      @AsOf("3.2.0") public AttributeTrack.Builder<V> operation(AttributeOperation operation)
      Sets the operation of the track.
      Parameters:
      operation - the operation of the track
      Returns:
      this builder
      Since:
      3.2.0
    • easing

      @AsOf("3.2.0") public AttributeTrack.Builder<V> easing(Easing easing)
      Sets the easing function of the track.
      Parameters:
      easing - the easing function of the track
      Returns:
      this builder
      Since:
      3.2.0
    • keyframes

      @AsOf("3.2.0") public AttributeTrack.Builder<V> keyframes(List<Keyframe<?>> keyframes)
      Sets the keyframes of the track.
      Parameters:
      keyframes - the keyframes of the track
      Returns:
      this builder
      Since:
      3.2.0
    • keyframe

      @AsOf("3.2.0") public AttributeTrack.Builder<V> keyframe(int ticks, V value)
      Adds a keyframe to the track.
      Parameters:
      ticks - the tick at which the keyframe should be applied
      value - the value of the attribute at the given tick
      Returns:
      this builder
      Since:
      3.2.0
    • keyframe

      @AsOf("3.2.0") public AttributeTrack.Builder<V> keyframe(int ticks, String hex)
      Adds a keyframe to a color attribute from a hex string (e.g. "#FF10F0").
      Parameters:
      ticks - the tick at which the keyframe should be applied
      hex - the hex string of the color at the given tick
      Returns:
      this builder
      Since:
      3.2.0
    • keyframe

      @AsOf("3.2.0") public AttributeTrack.Builder<V> keyframe(int ticks, float value, float alpha)
      Adds an AttributeOperation.ALPHA_BLEND keyframe to a float attribute.
      Parameters:
      ticks - the tick at which the keyframe should be applied
      value - the value of the attribute at the given tick
      alpha - the alpha value of the attribute at the given tick
      Returns:
      this builder
      Since:
      3.2.0
    • grayKeyframe

      @AsOf("3.2.0") public AttributeTrack.Builder<V> grayKeyframe(int ticks, float brightness, float factor)
      Adds an AttributeOperation.BLEND_TO_GRAY keyframe to a color attribute.
      Parameters:
      ticks - the tick at which the keyframe should be applied
      brightness - the brightness of the color at the given tick
      factor - the factor of the color at the given tick
      Returns:
      this builder
      Since:
      3.2.0
    • build

      @AsOf("3.2.0") public AttributeTrack<V> build()
      Builds the attribute track.
      Returns:
      the built attribute track
      Since:
      3.2.0