Class EntityAnimator<E extends net.minecraft.world.entity.LivingEntity,M extends IModelPartProvider<E>>
java.lang.Object
dev.oxydien.mathimations.animations.EntityAnimator<E,M>
- Type Parameters:
E- The type of the entityM- Model part provider
public class EntityAnimator<E extends net.minecraft.world.entity.LivingEntity,M extends IModelPartProvider<E>>
extends Object
The main controller that manages all animation layers for an entity.
Coordinates updates and uses the mixer to produce final poses.
If you don't know what you are doing, you probably want to use
EntityAnimationWrapper instead.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintGet the number of layers in this animatorvoidplayAnimation(byte layerIndex, short animationId) Play an animation on a specific layervoidplayAnimationIf(byte layerIndex, short animationId, IAnimationCondition condition) Play an animation on a specific layer if the condition is metvoidregisterAnimation(byte layerIndex, short animationId, IMathAnimation<E> animation) Register an animation to a specific layervoidreset()Reset all model parts to their default posevoidstopAnimation(byte layerIndex, short animationId, float transitionTime) Stop an animation on a specific layervoidstopLayer(byte layerIndex, float transitionTime) Stop all animations on a specific layerupdatePose(float partialTicks) Update all layers and apply final pose to the model
-
Constructor Details
-
EntityAnimator
-
-
Method Details
-
registerAnimation
Register an animation to a specific layer- Parameters:
layerIndex- The layer index (0 = highest priority)animationId- The animation IDanimation- The animation implementation
-
playAnimation
public void playAnimation(byte layerIndex, short animationId) Play an animation on a specific layer- Parameters:
layerIndex- The layer indexanimationId- The animation ID (if not found: ignored)
-
stopAnimation
public void stopAnimation(byte layerIndex, short animationId, float transitionTime) Stop an animation on a specific layer- Parameters:
layerIndex- The layer indexanimationId- The animation IDtransitionTime- Time to fade out (-1 to use animation's default transition time)
-
stopLayer
public void stopLayer(byte layerIndex, float transitionTime) Stop all animations on a specific layer- Parameters:
layerIndex- The layer indextransitionTime- Time to fade out (-1 to use animation's default transition time)
-
playAnimationIf
Play an animation on a specific layer if the condition is met- Parameters:
layerIndex- The layer indexanimationId- The animation IDcondition- The condition to check
-
updatePose
Update all layers and apply final pose to the model- Parameters:
partialTicks- The partial tick time- Returns:
- The final merged pose (for debugging/inspection)
-
reset
public void reset()Reset all model parts to their default pose -
getLayerCount
public int getLayerCount()Get the number of layers in this animator- Returns:
- The number of layers
-