Interface ActiveBattleAnimation

All Superinterfaces:
ContextHolder
All Known Implementing Classes:
AttackAnimation, BattleAnimationInstance, BattleAnimationTimeline, ClientBattleAnimationInstance, ContextualBattleAnimationInstance, DelayedActiveBattleAnimation

public interface ActiveBattleAnimation extends ContextHolder
Runtime handle for any animation currently playing against a battle.
  • Method Details

    • controller

      BattleController controller()
      Returns the battle controller this animation is attached to.
      Returns:
      the owning battle controller
    • audience

      default BattleAnimationAudience audience()
      Returns the audience scope for this animation.
      Returns:
      the animation audience
    • user

      @Nullable PixelmonWrapper user()
      Returns the Pokemon using the animated action.
      Returns:
      the user Pokemon, or null when not applicable
    • target

      @Nullable PixelmonWrapper target()
      Returns the Pokemon targeted by the animated action.
      Returns:
      the target Pokemon, or null when not applicable
    • attack

      @Nullable Attack attack()
      Returns the attack associated with this animation.
      Returns:
      the attack, or null when 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:
      true when 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:
      true when this animation blocks battle progression
    • isChannelBusy

      default boolean isChannelBusy(String channel)
      Checks whether an animation channel is currently busy.
      Parameters:
      channel - the channel to check
      Returns:
      true when the channel is busy
    • cleanUpChannel

      default void cleanUpChannel(String channel)
      Cleans up queued or active work in a specific animation channel.
      Parameters:
      channel - the channel to clean up
    • acknowledgeClient

      default void acknowledgeClient(UUID playerId, UUID acknowledgementId)
      Records a client acknowledgement for this animation.
      Parameters:
      playerId - the acknowledging player
      acknowledgementId - the acknowledgement id
    • isContextAlive

      default boolean isContextAlive()
      Checks whether the entities used by this animation are still present.
      Returns:
      true when the animation context is still valid
    • getContext

      default StoredContext getContext()
      Specified by:
      getContext in interface ContextHolder