Class KeyframeAnimationPlayer

java.lang.Object
dev.kosmx.playerAnim.api.layered.KeyframeAnimationPlayer
All Implemented Interfaces:
IActualAnimation<KeyframeAnimationPlayer>, IAnimation

public class KeyframeAnimationPlayer extends Object implements IActualAnimation<KeyframeAnimationPlayer>

KeyframeAnimationPlayer

If you're here, you're probably looking for this (except if you want to animate from code)
It plays KeyframeAnimation

new KeyframeAnimationPlayer(animation)


New FirstPerson mode is supported with chainable setters :D
new KeyframeAnimationPlayer(animation)
.setFirstPersonConfiguration(new FirstPersonConfiguration())
.setFirstPersonMode(FirstPersonMode.THIRD_PERSON_MODEL);
  • Field Details

  • Constructor Details

    • KeyframeAnimationPlayer

      public KeyframeAnimationPlayer(@NotNull @NotNull KeyframeAnimation animation, int t, boolean mutable)
      Parameters:
      animation - animation to play
      t - begin playing from tick
      mutable - if true, the part data will be copied as a construction step. The copied version can be changed while playing the animation but the copy takes time.
    • KeyframeAnimationPlayer

      public KeyframeAnimationPlayer(@NotNull @NotNull KeyframeAnimation animation, int t)
      Parameters:
      animation - KeyframeAnimation to play
      t - begin playing from tick
    • KeyframeAnimationPlayer

      public KeyframeAnimationPlayer(@NotNull @NotNull KeyframeAnimation animation)
  • Method Details

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

      public int getTick()
    • stop

      public void stop()
    • 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
    • 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
    • isLoopStarted

      public boolean isLoopStarted()
      is the emote already in an infinite loop?
      Returns:
      :D
    • getData

      public KeyframeAnimation getData()
    • getPart

      public KeyframeAnimationPlayer.BodyPart getPart(String string)
    • getStopTick

      public int getStopTick()
    • getCurrentTick

      public int getCurrentTick()
    • isInfinite

      public boolean isInfinite()