Record Class AnimationModifier

java.lang.Object
java.lang.Record
kr.toxicity.model.api.animation.AnimationModifier
Record Components:
predicate - predicate
start - start lerp
end - end lerp
type - animation type
speed - speed modifier
override - override
player - player

public record AnimationModifier(@NotNull BooleanSupplier predicate, int start, int end, AnimationIterator.Type type, @NotNull FloatSupplier speed, @Nullable Boolean override, @Nullable org.bukkit.entity.Player player) extends Record
A modifier of animation.
  • Field Details

    • DEFAULT

      public static final AnimationModifier DEFAULT
      Default modifier
    • DEFAULT_WITH_PLAY_ONCE

      public static final AnimationModifier DEFAULT_WITH_PLAY_ONCE
      Default with play once modifier
  • Constructor Details

    • AnimationModifier

      public AnimationModifier(int start, int end, float speed)
      Creates modifier
      Parameters:
      start - start time
      end - end time
      speed - speed
    • AnimationModifier

      public AnimationModifier(@NotNull @NotNull BooleanSupplier predicate, int start, int end, float speed)
      Creates modifier
      Parameters:
      predicate - animation predicate
      start - start time
      end - end time
      speed - speed
    • AnimationModifier

      public AnimationModifier(@NotNull @NotNull BooleanSupplier predicate, int start, int end, @NotNull @NotNull FloatSupplier supplier)
      Creates modifier
      Parameters:
      predicate - animation predicate
      start - start time
      end - end time
      supplier - speed supplier
    • AnimationModifier

      public AnimationModifier(@NotNull @NotNull BooleanSupplier predicate, int start, int end, @Nullable AnimationIterator.Type type, float speed)
      Creates modifier
      Parameters:
      predicate - animation predicate
      start - start time
      end - end time
      type - type
      speed - speed
    • AnimationModifier

      public AnimationModifier(@NotNull @NotNull BooleanSupplier predicate, int start, int end, @Nullable AnimationIterator.Type type, @NotNull @NotNull FloatSupplier speed)
      Creates modifier
      Parameters:
      predicate - animation predicate
      start - start time
      end - end time
      type - type
      speed - speed
    • AnimationModifier

      public AnimationModifier(@NotNull @NotNull BooleanSupplier predicate, int start, int end, @Nullable AnimationIterator.Type type, @NotNull @NotNull FloatSupplier speed, @Nullable @Nullable Boolean override, @Nullable @Nullable org.bukkit.entity.Player player)
      Creates an instance of a AnimationModifier record class.
      Parameters:
      predicate - the value for the predicate record component
      start - the value for the start record component
      end - the value for the end record component
      type - the value for the type record component
      speed - the value for the speed record component
      override - the value for the override record component
      player - the value for the player record component
  • Method Details

    • builder

      @NotNull public static @NotNull AnimationModifier.Builder builder()
      Creates builder
      Returns:
      builder
    • type

      @NotNull public AnimationIterator.Type type(@NotNull AnimationIterator.Type defaultType)
      Gets modifier's type or default value
      Parameters:
      defaultType - default value
      Returns:
      modifier's type or default value
    • speedValue

      public float speedValue()
      Gets speed value
      Returns:
      speed value
    • override

      public boolean override(boolean original)
      Gets override
      Parameters:
      original - original value
      Returns:
      override
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • predicate

      @NotNull public @NotNull BooleanSupplier predicate()
      Returns the value of the predicate record component.
      Returns:
      the value of the predicate record component
    • start

      public int start()
      Returns the value of the start record component.
      Returns:
      the value of the start record component
    • end

      public int end()
      Returns the value of the end record component.
      Returns:
      the value of the end record component
    • type

      @Nullable public AnimationIterator.Type type()
      Returns the value of the type record component.
      Returns:
      the value of the type record component
    • speed

      @NotNull public @NotNull FloatSupplier speed()
      Returns the value of the speed record component.
      Returns:
      the value of the speed record component
    • override

      @Nullable public @Nullable Boolean override()
      Returns the value of the override record component.
      Returns:
      the value of the override record component
    • player

      @Nullable public @Nullable org.bukkit.entity.Player player()
      Returns the value of the player record component.
      Returns:
      the value of the player record component