java.lang.Object
java.lang.Enum<Easing>
com.pixelmonmod.pixelmon.api.battles.attack.animation.transform.Easing
All Implemented Interfaces:
Serializable, Comparable<Easing>, Constable

public enum Easing extends Enum<Easing>
Easing functions used to convert animation tick progress into smoothed interpolation progress.

Easing is used by animation transforms to control how movement, growth, or other time-based values progress over a fixed duration. The input progress is calculated from the current tick and total tick duration, clamped to the range 0.0F to 1.0F, passed through the selected easing function, and then clamped again before being returned.

  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    Ease-in interpolation that starts slowly and accelerates over time.
    Ease-out interpolation that starts quickly and decelerates over time.
    Linear easing with a constant rate of change.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final com.mojang.serialization.Codec<Easing>
    Codec for encoding and decoding easing functions by enum name.
  • Method Summary

    Modifier and Type
    Method
    Description
    float
    apply(int currentTick, int totalTicks)
    Applies this easing function to the current animation progress.
    static Easing
    Returns the enum constant of this class with the specified name.
    static Easing[]
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • LINEAR

      public static final Easing LINEAR
      Linear easing with a constant rate of change.
    • EASE_IN

      public static final Easing EASE_IN
      Ease-in interpolation that starts slowly and accelerates over time.
    • EASE_OUT

      public static final Easing EASE_OUT
      Ease-out interpolation that starts quickly and decelerates over time.
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<Easing> CODEC
      Codec for encoding and decoding easing functions by enum name.
  • Method Details

    • values

      public static Easing[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static Easing valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • apply

      public float apply(int currentTick, int totalTicks)
      Applies this easing function to the current animation progress.

      The current progress is derived from currentTick / totalTicks. Values outside the valid range are clamped, and a non-positive totalTicks value is treated as complete progress.

      Parameters:
      currentTick - the current animation tick
      totalTicks - the total duration of the animation section in ticks
      Returns:
      the eased progress value, clamped between 0.0F and 1.0F