Class AbstractFadeModifier

All Implemented Interfaces:
IAnimation

public abstract class AbstractFadeModifier extends AbstractModifier
Use with ModifierLayer. Set an animation as a fade from. length in ticks
  • Field Details

    • time

      protected int time
    • length

      protected int length
    • beginAnimation

      @Nullable protected @Nullable IAnimation beginAnimation
      Animation to move from, null if transparent (easing in) use setBeginAnimation(IAnimation); //generated by Lombok plugin
  • Constructor Details

    • AbstractFadeModifier

      protected AbstractFadeModifier(int length)
  • Method Details

    • isActive

      public boolean isActive()
      Description copied from interface: IAnimation
      Is the animation currently active. Tick will only be invoked when ACTIVE
      Specified by:
      isActive in interface IAnimation
      Overrides:
      isActive in class AnimationContainer<IAnimation>
      Returns:
      active
    • canRemove

      public boolean canRemove()
      Overrides:
      canRemove in class AbstractModifier
      Returns:
      modifier can be removed.
    • setupAnim

      public void setupAnim(float tickDelta)
      Description copied from interface: IAnimation
      Called before rendering a character
      Specified by:
      setupAnim in interface IAnimation
      Overrides:
      setupAnim in class AnimationContainer<IAnimation>
      Parameters:
      tickDelta - Time since the last tick. 0-1
    • tick

      public void tick()
      Description copied from interface: IAnimation
      Animation tick, on lag free client 20 [tick/sec] You can get the animations time from other places, but it will be invoked when the animation is ACTIVE
      Specified by:
      tick in interface IAnimation
      Overrides:
      tick in class AnimationContainer<IAnimation>
    • get3DTransform

      @NotNull public @NotNull Vec3f get3DTransform(@NotNull @NotNull String modelName, @NotNull @NotNull TransformType type, float tickDelta, @NotNull @NotNull Vec3f value0)
      Description copied from interface: IAnimation
      Get the transformed value to a model part, transform type.
      Specified by:
      get3DTransform in interface IAnimation
      Overrides:
      get3DTransform in class AnimationContainer<IAnimation>
      Parameters:
      modelName - The questionable model part
      type - Transform type
      tickDelta - Time since the last tick. 0-1
      value0 - The value before the transform. For identity transform return with it.
      Returns:
      The new transform value
    • calculateProgress

      protected float calculateProgress(float f)
    • getAlpha

      protected abstract float getAlpha(String modelName, TransformType type, float progress)
      Get the alpha at the given progress
      Parameters:
      modelName - modelName if you want to handle parts differently
      type - Transform type
      progress - animation progress, float between 0 and 1
      Returns:
      alpha, float between 0 and 1, lower value means less visible from animation
    • standardFadeIn

      public static AbstractFadeModifier standardFadeIn(int length, Ease ease)
      Creates a standard fade with some easing in it.
      Parameters:
      length - ease length in ticks
      ease - ease function from Ease
      Returns:
      fade modifier
    • functionalFadeIn

      public static AbstractFadeModifier functionalFadeIn(int length, AbstractFadeModifier.EasingFunction function)
      Functional constructor for functional folks
      Parameters:
      length - ease length
      function - ease function
      Returns:
      fade