Class ClientBattleAnimationContext

java.lang.Object
com.pixelmonmod.pixelmon.api.battles.animation.client.ClientBattleAnimationContext

public class ClientBattleAnimationContext extends Object
Client-side lookup context used by client-backed battle animation actions.
  • Constructor Details

  • Method Details

    • minecraft

      public net.minecraft.client.Minecraft minecraft()
      Returns the active Minecraft client instance.
      Returns:
      the Minecraft client
    • camera

      @Nullable public CameraEntity camera()
      Returns the battle camera entity when one is active.
      Returns:
      the battle camera, or null
    • scene

      @Nullable public BattleSceneClientLevel scene()
      Returns the active battle scene level.
      Returns:
      the active scene, or null
    • cameraTarget

      public Optional<CameraTarget> cameraTarget(BattleAnimationSubject subject)
      Resolves the camera target for an animation subject.
      Parameters:
      subject - the subject to resolve
      Returns:
      a camera target, if one can be found
    • cameraTarget

      public Optional<CameraTarget> cameraTarget(BattleAnimationSubject subject, net.minecraft.world.phys.Vec3 offset)
      Resolves the camera target for an animation subject with an optional subject-relative offset.
      Parameters:
      subject - the subject to resolve
      offset - the world-space offset from the resolved subject target
      Returns:
      a camera target, if one can be found
    • position

      public Optional<net.minecraft.world.phys.Vec3> position(BattleAnimationSubject subject)
      Resolves the world position for an animation subject.
      Parameters:
      subject - the subject to resolve
      Returns:
      the subject position, if one can be found
    • applyCameraPosition

      public void applyCameraPosition(CameraEntity camera, BattleAnimationSubject subject)
      Moves the battle camera to the starting position for a subject.
      Parameters:
      camera - the battle camera to position
      subject - the subject used for positioning
    • applyCameraPosition

      public void applyCameraPosition(CameraEntity camera, BattleAnimationSubject subject, net.minecraft.world.phys.Vec3 offset)
      Moves the battle camera to the starting position for a subject with an optional subject-relative offset.
      Parameters:
      camera - the battle camera to position
      subject - the subject used for positioning
      offset - the world-space offset from the resolved subject position
    • pokemon

      @Nullable public PixelmonEntity pokemon(BattleAnimationSubject subject)
      Resolves a subject to a rendered Pokemon entity.
      Parameters:
      subject - the subject to resolve
      Returns:
      the Pokemon entity, or null
    • pokemonId

      public Optional<UUID> pokemonId(BattleAnimationSubject subject)
      Resolves the Pokemon UUID associated with a subject.
      Parameters:
      subject - the subject to resolve
      Returns:
      the Pokemon UUID, if present
    • pokemonData

      @Nullable public PixelmonClientData pokemonData(BattleAnimationSubject subject)
      Resolves currently displayed battle UI data for a subject.
      Parameters:
      subject - the subject to resolve
      Returns:
      displayed Pokemon data, or null
    • pendingPokemonData

      @Nullable public PixelmonClientData pendingPokemonData(BattleAnimationSubject subject)
      Resolves pending battle UI data for a subject.
      Parameters:
      subject - the subject to resolve
      Returns:
      pending Pokemon data, or null
    • entity

      @Nullable public net.minecraft.world.entity.Entity entity(BattleAnimationSubject subject)
      Resolves a subject to a rendered entity.
      Parameters:
      subject - the subject to resolve
      Returns:
      the subject entity, or null