Class ClientBattleAnimationContext
java.lang.Object
com.pixelmonmod.pixelmon.api.battles.animation.client.ClientBattleAnimationContext
Client-side lookup context used by client-backed battle animation actions.
-
Constructor Summary
ConstructorsConstructorDescriptionClientBattleAnimationContext(Optional<UUID> userPokemon, Optional<UUID> targetPokemon) ClientBattleAnimationContext(Optional<UUID> userPokemon, Optional<UUID> targetPokemon, Optional<PixelmonClientData> userPokemonData, Optional<PixelmonClientData> targetPokemonData) -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyCameraPosition(CameraEntity camera, BattleAnimationSubject subject) Moves the battle camera to the starting position for a subject.voidapplyCameraPosition(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.camera()Returns the battle camera entity when one is active.cameraTarget(BattleAnimationSubject subject) Resolves the camera target for an animation subject.cameraTarget(BattleAnimationSubject subject, net.minecraft.world.phys.Vec3 offset) Resolves the camera target for an animation subject with an optional subject-relative offset.net.minecraft.world.entity.Entityentity(BattleAnimationSubject subject) Resolves a subject to a rendered entity.net.minecraft.client.MinecraftReturns the active Minecraft client instance.pendingPokemonData(BattleAnimationSubject subject) Resolves pending battle UI data for a subject.pokemon(BattleAnimationSubject subject) Resolves a subject to a rendered Pokemon entity.pokemonData(BattleAnimationSubject subject) Resolves currently displayed battle UI data for a subject.pokemonId(BattleAnimationSubject subject) Resolves the Pokemon UUID associated with a subject.Optional<net.minecraft.world.phys.Vec3> position(BattleAnimationSubject subject) Resolves the world position for an animation subject.scene()Returns the active battle scene level.
-
Constructor Details
-
ClientBattleAnimationContext
-
ClientBattleAnimationContext
public ClientBattleAnimationContext(Optional<UUID> userPokemon, Optional<UUID> targetPokemon, Optional<PixelmonClientData> userPokemonData, Optional<PixelmonClientData> targetPokemonData)
-
-
Method Details
-
minecraft
public net.minecraft.client.Minecraft minecraft()Returns the active Minecraft client instance.- Returns:
- the Minecraft client
-
camera
Returns the battle camera entity when one is active.- Returns:
- the battle camera, or
null
-
scene
Returns the active battle scene level.- Returns:
- the active scene, or
null
-
cameraTarget
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 resolveoffset- the world-space offset from the resolved subject target- Returns:
- a camera target, if one can be found
-
position
Resolves the world position for an animation subject.- Parameters:
subject- the subject to resolve- Returns:
- the subject position, if one can be found
-
applyCameraPosition
Moves the battle camera to the starting position for a subject.- Parameters:
camera- the battle camera to positionsubject- 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 positionsubject- the subject used for positioningoffset- the world-space offset from the resolved subject position
-
pokemon
Resolves a subject to a rendered Pokemon entity.- Parameters:
subject- the subject to resolve- Returns:
- the Pokemon entity, or
null
-
pokemonId
Resolves the Pokemon UUID associated with a subject.- Parameters:
subject- the subject to resolve- Returns:
- the Pokemon UUID, if present
-
pokemonData
Resolves currently displayed battle UI data for a subject.- Parameters:
subject- the subject to resolve- Returns:
- displayed Pokemon data, or
null
-
pendingPokemonData
Resolves pending battle UI data for a subject.- Parameters:
subject- the subject to resolve- Returns:
- pending Pokemon data, or
null
-
entity
Resolves a subject to a rendered entity.- Parameters:
subject- the subject to resolve- Returns:
- the subject entity, or
null
-