Interface BattleAnimationAction
- All Known Subinterfaces:
ClientBackedBattleAnimationAction
- All Known Implementing Classes:
AttackBattleAnimationAction,AttackEffectBattleAnimationAction,BattleCameraAnimationAction,BattleExitAnimationAction,BattleParticleAnimationAction,BattleSoundAnimationAction,DelayedBattleAnimationAction,LeapForwardBattleAnimationAction,ModelBattleAnimationAction,MovementBattleAnimationAction,PokemonAnimationAction,PokemonTerastalEffectAnimationAction,PokemonUiCurrentHealthAnimationAction,PokemonUiFaintAnimationAction,PokemonUiHealthAnimationAction,PokemonUiSwitchInAnimationAction,PokemonUiSwitchOutAnimationAction,PokemonVisibilityAnimationAction,RunBattleAnimationAction,SceneBlockAnimationAction,UiVisibilityAnimationAction,VerticalStompBattleAnimationAction
public interface BattleAnimationAction
Strategy for one part of a battle animation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<BattleAnimationAction> -
Method Summary
Modifier and TypeMethodDescriptiondefault voidcleanUp(BattleAnimationInstance animation) Cleans up any state created while this action was playing.com.mojang.serialization.MapCodec<? extends BattleAnimationAction> codec()Returns the codec used to serialize this action.default booleanisFinished(BattleAnimationInstance animation) Checks whether this action has completed.default ActiveBattleAnimationplay(BattleAnimationContext context) Creates the runtime animation instance for this action.default voidtick(BattleAnimationInstance animation) Advances this action by one server tick.BattleAnimationActionType<? extends BattleAnimationAction> type()Returns the registered action type for this action.
-
Field Details
-
CODEC
-
-
Method Details
-
codec
com.mojang.serialization.MapCodec<? extends BattleAnimationAction> codec()Returns the codec used to serialize this action.- Returns:
- this action's map codec
-
type
BattleAnimationActionType<? extends BattleAnimationAction> type()Returns the registered action type for this action.- Returns:
- this action's registered type
-
play
Creates the runtime animation instance for this action.- Parameters:
context- the battle animation context- Returns:
- the active runtime animation
-
tick
Advances this action by one server tick.- Parameters:
animation- the active runtime animation
-
isFinished
Checks whether this action has completed.- Parameters:
animation- the active runtime animation- Returns:
truewhen the action is finished
-
cleanUp
Cleans up any state created while this action was playing.- Parameters:
animation- the active runtime animation
-