Class FpAnimationSystem
java.lang.Object
com.github.razorplay01.fp_pal.firstperson.FpAnimationSystem
Central system for first-person animations.
Handles registration, ticking, and synchronization of FP animations.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.minecraft.resources.Identifier -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanRemove a forced first-person mode, going back to the automatic behaviour.static com.zigythebird.playeranimcore.api.firstPerson.FirstPersonModestatic voidinit()Initialize the FP animation system.static booleanplayFpAnimation(net.minecraft.client.player.AbstractClientPlayer player, net.minecraft.resources.Identifier fpAnimationId) Play a FP animation for the given player.static voidregisterPaired(net.minecraft.resources.Identifier thirdPersonId, net.minecraft.resources.Identifier fpId) Register a paired 3rd person + FP animation.static booleansetFirstPersonMode(com.zigythebird.playeranimcore.api.firstPerson.FirstPersonMode mode) Force a first-person mode on the local player's FP controller, overriding the automaticFirstPersonMode.NONEreported while an FP animation is playing.static voidStop the currently playing FP animation.static voidupdateRenderState(net.minecraft.client.player.AbstractClientPlayer player) Update the FP render state.
-
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 automaticFirstPersonMode.NONEreported 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.
-