Class FpAnimationController
java.lang.Object
com.zigythebird.playeranimcore.animation.AnimationController
com.zigythebird.playeranimcore.animation.HumanoidAnimationController
com.zigythebird.playeranim.animation.PlayerAnimationController
com.github.razorplay01.fp_pal.firstperson.FpAnimationController
- All Implemented Interfaces:
com.zigythebird.playeranimcore.animation.layered.IAnimation
public class FpAnimationController
extends com.zigythebird.playeranim.animation.PlayerAnimationController
Separate animation controller for first-person animations.
This is independent from the 3rd person animation stack to avoid priority conflicts.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.zigythebird.playeranimcore.animation.AnimationController
com.zigythebird.playeranimcore.animation.AnimationController.AnimationSetter, com.zigythebird.playeranimcore.animation.AnimationController.AnimationStateHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.zigythebird.playeranimcore.api.firstPerson.FirstPersonConfigurationBoth arms and both held items are shown by default in player-arm mode.Fields inherited from class com.zigythebird.playeranim.animation.PlayerAnimationController
avatarFields inherited from class com.zigythebird.playeranimcore.animation.HumanoidAnimationController
BONE_POSITIONS, top_bonesFields inherited from class com.zigythebird.playeranimcore.animation.AnimationController
activeBones, animationData, animationQueue, animationState, bonePositions, bones, currentAnimation, currentRawAnimation, customKeyframeHandler, EMPTY_KEYFRAME_LOCATION, EMPTY_SCALE_KEYFRAME_LOCATION, firstPersonConfiguration, firstPersonMode, handlingTriggeredAnimations, isLoopStarted, molangRuntime, needsAnimationReload, overrideEasingTypeFunction, particleKeyframeHandler, pivotBones, postAnimationSetupConsumer, soundKeyframeHandler, startAnimFrom, stateHandler, tick, triggeredAnimationFields inherited from interface com.zigythebird.playeranimcore.animation.layered.IAnimation
DEFAULT_FIRST_PERSON_CONFIG -
Constructor Summary
ConstructorsConstructorDescriptionFpAnimationController(net.minecraft.world.entity.Avatar player, com.zigythebird.playeranimcore.animation.AnimationController.AnimationStateHandler animationStateHandler, com.zigythebird.playeranim.animation.AvatarAnimManager thirdPersonManager) -
Method Summary
Modifier and TypeMethodDescriptionvoidRemoves a forced first-person mode, going back to the automatic one.voidvoidcom.zigythebird.playeranimcore.bones.PlayerAnimBoneget3DTransformRaw(com.zigythebird.playeranimcore.bones.PlayerAnimBone bone) Outside first person this layer must leave every bone untouched (returning the input bone is the no-op); resetting it would overwrite the third-person animation.com.zigythebird.playeranimcore.math.Vec3fgetBonePosition(String name) net.minecraft.resources.Identifiercom.zigythebird.playeranimcore.api.firstPerson.FirstPersonConfigurationcom.zigythebird.playeranimcore.api.firstPerson.FirstPersonModeReportsFirstPersonMode.NONEunless a mode was forced with/fp_anim mode.com.zigythebird.playeranim.animation.AvatarAnimManagerbooleanisActive()booleanbooleanbooleanbooleanvoidRegisters every bone of the first-person rig:fp_player_arms(root), the arms, the held items andfp_camera.voidvoidsetActive(boolean active) voidsetCurrentFpAnimation(net.minecraft.resources.Identifier id) Sets the FP animation to play.protected voidRegisters every bone the incoming first-person animation uses, so AzureLib extra bones (mag,slide,flash...) are kept instead of being ignored.Methods inherited from class com.zigythebird.playeranim.animation.PlayerAnimationController
getAvatar, getBoneWorldPositionPoseStack, replaceAnimationWithFade, replaceAnimationWithFade, triggerAnimation, triggerAnimationMethods inherited from class com.zigythebird.playeranimcore.animation.HumanoidAnimationController
process, registerTopPlayerAnimBoneMethods inherited from class com.zigythebird.playeranimcore.animation.AnimationController
addModifier, addModifierBefore, addModifierLast, applyCustomPivotPoints, forceAnimationReset, get3DTransform, getAnimationData, getAnimationSpeed, getAnimationState, getAnimationTicks, getAnimationTime, getBone, getCurrentAnimation, getCurrentAnimationInstance, getCurrentRawAnimation, getModifier, getModifierCount, getModifiers, getQueuedAnimations, getTriggeredAnimation, handleAnimation, handleCustomKeyframe, hasAnimationFinished, hasBeginTick, hasEndTick, isAnimationPlayerAnimatorFormat, isDisableAxisIfNotModified, isLoopStarted, isPlayingTriggeredAnimation, linkModifiers, pause, receiveTriggeredAnimations, registerPlayerAnimBone, registerPlayerAnimBone, removeAllModifiers, removeModifier, removeModifierIf, replaceAnimationWithFade, replaceAnimationWithFade, replaceAnimationWithFade, replaceAnimationWithFade, resetEventKeyFrames, setAnimation, setAnimation, setCustomInstructionKeyframeHandler, setFirstPersonConfiguration, setFirstPersonConfigurationHandler, setFirstPersonMode, setFirstPersonModeHandler, setOverrideEasingType, setOverrideEasingTypeFunction, setParticleKeyframeHandler, setPostAnimationSetupConsumer, setSoundKeyframeHandler, setupAnim, stop, stopTriggeredAnimation, tick, toString, triggerAnimation, triggerAnimation, triggerAnimation, triggerAnimation, unpauseMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.zigythebird.playeranimcore.animation.layered.IAnimation
canRemove, get3DTransform
-
Field Details
-
FP_BONE_POSITIONS
-
DEFAULT_FP_CONFIGURATION
public static final com.zigythebird.playeranimcore.api.firstPerson.FirstPersonConfiguration DEFAULT_FP_CONFIGURATIONBoth arms and both held items are shown by default in player-arm mode.
-
-
Constructor Details
-
FpAnimationController
public FpAnimationController(net.minecraft.world.entity.Avatar player, com.zigythebird.playeranimcore.animation.AnimationController.AnimationStateHandler animationStateHandler, com.zigythebird.playeranim.animation.AvatarAnimManager thirdPersonManager)
-
-
Method Details
-
getThirdPersonManager
public com.zigythebird.playeranim.animation.AvatarAnimManager getThirdPersonManager() -
getCurrentFpAnimation
@Nullable public net.minecraft.resources.Identifier getCurrentFpAnimation() -
setCurrentFpAnimation
public void setCurrentFpAnimation(@Nullable net.minecraft.resources.Identifier id) Sets the FP animation to play. A non-null id also arms the next play request. -
requestStop
public void requestStop() -
isPendingPlay
public boolean isPendingPlay() -
clearPendingPlay
public void clearPendingPlay() -
isActive
public boolean isActive()- Specified by:
isActivein interfacecom.zigythebird.playeranimcore.animation.layered.IAnimation- Overrides:
isActivein classcom.zigythebird.playeranimcore.animation.AnimationController
-
isRunning
public boolean isRunning()- Returns:
- whether this controller is playing an animation, independently of the current camera.
Use this for the animation state handler;
isActive()is the render-layer check and is false while the local player is in third person.
-
setActive
public void setActive(boolean active) -
isStopRequested
public boolean isStopRequested() -
clearStopRequest
public void clearStopRequest() -
clearFirstPersonModeOverride
public void clearFirstPersonModeOverride()Removes a forced first-person mode, going back to the automatic one. -
getFirstPersonMode
@NotNull public com.zigythebird.playeranimcore.api.firstPerson.FirstPersonMode getFirstPersonMode()ReportsFirstPersonMode.NONEunless a mode was forced with/fp_anim mode. NONE is the only mode that leaves PAL's own first-person machinery idle, which this addon needs because it renders first person itself.- Specified by:
getFirstPersonModein interfacecom.zigythebird.playeranimcore.animation.layered.IAnimation- Overrides:
getFirstPersonModein classcom.zigythebird.playeranimcore.animation.AnimationController
-
isPlayerArmMode
public boolean isPlayerArmMode()- Returns:
- true while this controller is playing a first-person animation, i.e. while the vanilla
arm has to be replaced by the
fp_*rig.
-
getFirstPersonConfiguration
@NotNull public com.zigythebird.playeranimcore.api.firstPerson.FirstPersonConfiguration getFirstPersonConfiguration()- Specified by:
getFirstPersonConfigurationin interfacecom.zigythebird.playeranimcore.animation.layered.IAnimation- Overrides:
getFirstPersonConfigurationin classcom.zigythebird.playeranimcore.animation.AnimationController
-
get3DTransformRaw
public com.zigythebird.playeranimcore.bones.PlayerAnimBone get3DTransformRaw(@NotNull com.zigythebird.playeranimcore.bones.PlayerAnimBone bone) Outside first person this layer must leave every bone untouched (returning the input bone is the no-op); resetting it would overwrite the third-person animation.- Overrides:
get3DTransformRawin classcom.zigythebird.playeranimcore.animation.HumanoidAnimationController
-
getBonePosition
- Overrides:
getBonePositionin classcom.zigythebird.playeranimcore.animation.AnimationController
-
registerBones
public void registerBones()Registers every bone of the first-person rig:fp_player_arms(root), the arms, the held items andfp_camera. PAL's loader normalizesrightArm/leftArmtoright_arm/left_arm, so both spellings are registered. Any other bone is registered too (seesetupNewAnimation()).- Overrides:
registerBonesin classcom.zigythebird.playeranimcore.animation.HumanoidAnimationController
-
setupNewAnimation
protected void setupNewAnimation()Registers every bone the incoming first-person animation uses, so AzureLib extra bones (mag,slide,flash...) are kept instead of being ignored. They are available throughgetActiveBoneNames()/FpRenderState.getExtraBone(String), and their sound, particle and custom-instruction keyframes run through PAL's normal keyframe system.- Overrides:
setupNewAnimationin classcom.zigythebird.playeranimcore.animation.AnimationController
-
getActiveBoneNames
-
getAnimatedBoneNames
- Returns:
- only the bones that the current animation actually has keyframes for.
FpRenderState.updateExtraBones(AvatarAnimManager, Set)uses this: a bone with no keyframes must keep its static geo pose instead of being overwritten with an identity transform.
-