Class AnimationStack

java.lang.Object
dev.kosmx.playerAnim.api.layered.AnimationStack
All Implemented Interfaces:
IAnimation

public class AnimationStack extends Object implements IAnimation
Player animation stack, can contain multiple active or passive layers, will always be evaluated from the lowest index. Highest index = it can override everything else
  • Constructor Details

    • AnimationStack

      public AnimationStack()
  • 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
      Returns:
      true if exists level what is active.
    • 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
    • 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
      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
    • setupAnim

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

      public void addAnimLayer(int priority, IAnimation layer)
      Add an animation layer. If there are multiple with the same priority, the one, added first will have larger priority
      Parameters:
      priority - priority
      layer - animation layer note: Same priority entries logic is subject to change
    • removeLayer

      public boolean removeLayer(IAnimation layer)
      Remove an animation layer
      Parameters:
      layer - needle
      Returns:
      true if any elements were removed.
    • removeLayer

      public boolean removeLayer(int layerLevel)
      Remove EVERY layer with priority
      Parameters:
      layerLevel - search and destroy
      Returns:
      true if any elements were removed.
    • getFirstPersonMode

      @NotNull public @NotNull FirstPersonMode getFirstPersonMode(float tickDelta)
      Description copied from interface: IAnimation
      Active animation can request first person render mode.
      Specified by:
      getFirstPersonMode in interface IAnimation
      Parameters:
      tickDelta - current tickDelta
      Returns:
      FirstPersonMode
    • getFirstPersonConfiguration

      @NotNull public @NotNull FirstPersonConfiguration getFirstPersonConfiguration(float tickDelta)
      Specified by:
      getFirstPersonConfiguration in interface IAnimation
      Parameters:
      tickDelta -
      Returns:
      current first person configuration, only requested when playing this animation