Class PlayerAnimationFrame

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

public abstract class PlayerAnimationFrame extends Object implements IAnimation
Mixin it into a player, add to its Animation stack, and override its tick,

It is a representation of your pose on the frame. Override IAnimation.setupAnim(float) and set the pose there.

  • Field Details

  • Constructor Details

    • PlayerAnimationFrame

      public PlayerAnimationFrame()
  • Method Details

    • 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
    • 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
    • resetPose

      public void resetPose()
      Reset every part, those parts won't influence the animation Don't use it if you don't want to set every part in every frame
    • get3DTransform

      @NotNull public @NotNull Vec3f get3DTransform(@NotNull @NotNull PartKey modelKey, @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.

      API note
      DO NOT CALL super.get3DTransform() as the default implementation will be removed.

      Specified by:
      get3DTransform in interface IAnimation
      Parameters:
      modelKey - 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