Interface ActiveBattleAnimation
- All Superinterfaces:
ContextHolder
- All Known Implementing Classes:
AttackAnimation,BattleAnimationInstance,BattleAnimationTimeline,ClientBattleAnimationInstance,ContextualBattleAnimationInstance,DelayedActiveBattleAnimation
Runtime handle for any animation currently playing against a battle.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidacknowledgeClient(UUID playerId, UUID acknowledgementId) Records a client acknowledgement for this animation.attack()Returns the attack associated with this animation.default BattleAnimationAudienceaudience()Returns the audience scope for this animation.default booleanReturns whether battle flow should wait for this animation.voidcleanUp()Cleans up state owned by this animation.default voidcleanUpChannel(String channel) Cleans up queued or active work in a specific animation channel.Returns the battle controller this animation is attached to.copy(BattleController newController) Creates a copy of this animation attached to another battle controller.default StoredContextdefault booleanisChannelBusy(String channel) Checks whether an animation channel is currently busy.default booleanChecks whether the entities used by this animation are still present.booleanReturns whether this animation has finished.target()Returns the Pokemon targeted by the animated action.voidtick()Advances this animation by one battle tick.intticks()Returns the number of 20 TPS animation ticks this animation has been active.user()Returns the Pokemon using the animated action.Methods inherited from interface com.pixelmonmod.pixelmon.battles.controller.context.ContextHolder
get, getOrDefault, has, remove, set, update
-
Method Details
-
controller
BattleController controller()Returns the battle controller this animation is attached to.- Returns:
- the owning battle controller
-
audience
Returns the audience scope for this animation.- Returns:
- the animation audience
-
user
Returns the Pokemon using the animated action.- Returns:
- the user Pokemon, or
nullwhen not applicable
-
target
Returns the Pokemon targeted by the animated action.- Returns:
- the target Pokemon, or
nullwhen not applicable
-
attack
Returns the attack associated with this animation.- Returns:
- the attack, or
nullwhen not applicable
-
ticks
int ticks()Returns the number of 20 TPS animation ticks this animation has been active.- Returns:
- the active animation tick count
-
tick
void tick()Advances this animation by one battle tick. -
isFinished
boolean isFinished()Returns whether this animation has finished.- Returns:
truewhen the animation is finished
-
cleanUp
void cleanUp()Cleans up state owned by this animation. -
copy
Creates a copy of this animation attached to another battle controller.- Parameters:
newController- the replacement battle controller- Returns:
- the copied animation
-
blocksBattle
default boolean blocksBattle()Returns whether battle flow should wait for this animation.- Returns:
truewhen this animation blocks battle progression
-
isChannelBusy
Checks whether an animation channel is currently busy.- Parameters:
channel- the channel to check- Returns:
truewhen the channel is busy
-
cleanUpChannel
Cleans up queued or active work in a specific animation channel.- Parameters:
channel- the channel to clean up
-
acknowledgeClient
Records a client acknowledgement for this animation.- Parameters:
playerId- the acknowledging playeracknowledgementId- the acknowledgement id
-
isContextAlive
default boolean isContextAlive()Checks whether the entities used by this animation are still present.- Returns:
truewhen the animation context is still valid
-
getContext
- Specified by:
getContextin interfaceContextHolder
-