Package noppes.npcs.api.handler.data
Interface IAnimationData
-
public interface IAnimationData
Holds and manages animation data for an animatable entity. This includes the current animation, its timing, and the ability to update the animation state on clients.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
enabled()
Checks if animations are enabled.long
getAnimatingTime()
Returns the total time the current animation has been running.IAnimation
getAnimation()
Returns the current animation.IAnimatable
getEntity()
Retrieves the animatable entity this data is associated with.boolean
isActive()
Checks whether the current animation is active.boolean
isClientAnimating()
Checks whether the client is currently animating.void
setAnimation(IAnimation animation)
Sets the current animation.void
setEnabled(boolean enabled)
Enables or disables animations for the entity.void
updateClient()
Updates the animation data on the client side.
-
-
-
Method Detail
-
getEntity
IAnimatable getEntity()
Retrieves the animatable entity this data is associated with.- Returns:
- the animatable entity.
-
updateClient
void updateClient()
Updates the animation data on the client side.
-
isActive
boolean isActive()
Checks whether the current animation is active.- Returns:
- true if an animation is active; false otherwise.
-
isClientAnimating
boolean isClientAnimating()
Checks whether the client is currently animating.- Returns:
- true if client animation is active; false otherwise.
-
setEnabled
void setEnabled(boolean enabled)
Enables or disables animations for the entity.- Parameters:
enabled
- true to enable animations; false to disable.
-
enabled
boolean enabled()
Checks if animations are enabled.- Returns:
- true if enabled; false otherwise.
-
setAnimation
void setAnimation(IAnimation animation)
Sets the current animation.- Parameters:
animation
- the animation to set.
-
getAnimation
IAnimation getAnimation()
Returns the current animation.- Returns:
- the animation, or null if none is set.
-
getAnimatingTime
long getAnimatingTime()
Returns the total time the current animation has been running.- Returns:
- the animating time in ticks.
-
-