Class AnimationContainer<T extends IAnimation>

java.lang.Object
dev.kosmx.playerAnim.api.layered.AnimationContainer<T>
Type Parameters:
T - Nullable animation
All Implemented Interfaces:
IAnimation
Direct Known Subclasses:
AbstractModifier

public class AnimationContainer<T extends IAnimation> extends Object implements IAnimation
A container to make swapping animation object easier It will clone the behaviour of the held animation

you can put endless AnimationContainer into each other

  • Field Details

  • Constructor Details

    • AnimationContainer

      public AnimationContainer(@Nullable T anim)
    • AnimationContainer

      public AnimationContainer()
  • Method Details

    • setAnim

      public void setAnim(@Nullable T newAnim)
    • getAnim

      @Nullable public T getAnim()
    • 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:
      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
    • 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