Class FpAnimationSystem

java.lang.Object
com.github.razorplay01.fp_pal.firstperson.FpAnimationSystem

public class FpAnimationSystem extends Object
Central system for first-person animations. Handles registration, ticking, and synchronization of FP animations.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final net.minecraft.resources.Identifier
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    Remove a forced first-person mode, going back to the automatic behaviour.
    static com.zigythebird.playeranimcore.api.firstPerson.FirstPersonMode
     
    static void
    Initialize the FP animation system.
    static boolean
    playFpAnimation(net.minecraft.client.player.AbstractClientPlayer player, net.minecraft.resources.Identifier fpAnimationId)
    Play a FP animation for the given player.
    static void
    registerPaired(net.minecraft.resources.Identifier thirdPersonId, net.minecraft.resources.Identifier fpId)
    Register a paired 3rd person + FP animation.
    static boolean
    setFirstPersonMode(com.zigythebird.playeranimcore.api.firstPerson.FirstPersonMode mode)
    Force a first-person mode on the local player's FP controller, overriding the automatic FirstPersonMode.NONE reported while an FP animation is playing.
    static void
    Stop the currently playing FP animation.
    static void
    updateRenderState(net.minecraft.client.player.AbstractClientPlayer player)
    Update the FP render state.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • FP_ANIMATION_LAYER_ID

      public static final net.minecraft.resources.Identifier FP_ANIMATION_LAYER_ID
  • Constructor Details

    • FpAnimationSystem

      public FpAnimationSystem()
  • Method Details

    • init

      public static void init()
      Initialize the FP animation system. Call this during mod init.
    • updateRenderState

      public static void updateRenderState(net.minecraft.client.player.AbstractClientPlayer player)
      Update the FP render state. Call this every tick.
    • playFpAnimation

      public static boolean playFpAnimation(net.minecraft.client.player.AbstractClientPlayer player, net.minecraft.resources.Identifier fpAnimationId)
      Play a FP animation for the given player.
    • stopFpAnimation

      public static void stopFpAnimation()
      Stop the currently playing FP animation.
    • getFirstPersonMode

      @Nullable public static com.zigythebird.playeranimcore.api.firstPerson.FirstPersonMode getFirstPersonMode()
      Returns:
      the first-person mode the local player's FP controller currently reports, or null if there is no controller.
    • setFirstPersonMode

      public static boolean setFirstPersonMode(com.zigythebird.playeranimcore.api.firstPerson.FirstPersonMode mode)
      Force a first-person mode on the local player's FP controller, overriding the automatic FirstPersonMode.NONE reported while an FP animation is playing.
      Returns:
      false if there is no FP controller for the local player
    • clearFirstPersonModeOverride

      public static boolean clearFirstPersonModeOverride()
      Remove a forced first-person mode, going back to the automatic behaviour.
      Returns:
      false if there is no FP controller for the local player
    • registerPaired

      public static void registerPaired(net.minecraft.resources.Identifier thirdPersonId, net.minecraft.resources.Identifier fpId)
      Register a paired 3rd person + FP animation.