Interface AnimationLifetime
- All Known Implementing Classes:
AnyOfAnimationLifetime,DurationAnimationLifetime,EffectRemovedAnimationLifetime
An AnimationLifetime decides when an ActiveBattleAnimation has finished and
should be cleaned up. Implementations may use a fixed duration, a model animation ending,
a battle state condition being removed, the battle ending, or any other animation-specific
lifetime rule.
Lifetimes are data-driven and dispatched through the animation lifetime registry using
AnimationLifetimeType. Each implementation provides its registered type via
type(), allowing CODEC to decode the correct lifetime rule from
animation data.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<AnimationLifetime> Codec for decoding registered animation lifetime implementations. -
Method Summary
Modifier and TypeMethodDescriptionbooleanisFinished(ActiveBattleAnimation animation) Checks whether the supplied animation has finished and should be removed.type()Gets the registered lifetime type for this implementation.
-
Field Details
-
CODEC
Codec for decoding registered animation lifetime implementations.The concrete lifetime type is resolved through the animation lifetime registry, then dispatched to the matching
AnimationLifetimeType.codec().
-
-
Method Details
-
type
AnimationLifetimeType<?> type()Gets the registered lifetime type for this implementation.This is used by
CODECto dispatch to the correct implementation-specific codec when decoding data-driven animation definitions.- Returns:
- the registered animation lifetime type
-
isFinished
Checks whether the supplied animation has finished and should be removed.- Parameters:
animation- the active battle animation- Returns:
trueif the animation should be removed; otherwisefalse
-