Record Class BlueprintAnimation
java.lang.Object
java.lang.Record
kr.toxicity.model.api.data.blueprint.BlueprintAnimation
- Record Components:
name- the name of the animationloop- the default loop modelength- the length of the animation in secondsoverride- whether this animation overrides othersanimator- a map of animators for each bonescript- the script associated with this animation, if anyemptyAnimator- a list of empty movements, used as a fallback or for initialization
public record BlueprintAnimation(@NotNull String name, AnimationIterator.Type loop, float length, boolean override, @NotNull @Unmodifiable Map<BoneName,BlueprintAnimator> animator, @Nullable BlueprintScript script, @NotNull TimedStorage<AnimationProgress> emptyAnimator)
extends Record
Represents a complete, processed animation for a model.
This record contains all the necessary data to play an animation, including keyframes for each bone, loop settings, and associated scripts.
- Since:
- 1.15.2
-
Constructor Summary
ConstructorsConstructorDescriptionBlueprintAnimation(@NotNull String name, AnimationIterator.Type loop, float length, boolean override, @NotNull @Unmodifiable Map<BoneName, BlueprintAnimator> animator, @Nullable BlueprintScript script, @NotNull TimedStorage<AnimationProgress> emptyAnimator) Creates an instance of aBlueprintAnimationrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull @Unmodifiable Map<BoneName, BlueprintAnimator> animator()Returns the value of theanimatorrecord component.@NotNull TimedStorage<AnimationProgress> Returns the value of theemptyAnimatorrecord component.@NotNull AnimationIterator<AnimationProgress> Creates an iterator for the empty animation sequence.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.floatlength()Returns the value of thelengthrecord component.loop()Returns the value of thelooprecord component.@NotNull Stringname()Returns the value of thenamerecord component.booleanoverride()Returns the value of theoverriderecord component.@Nullable BlueprintScriptscript()Returns the value of thescriptrecord component.@Nullable BlueprintScriptscript(@NotNull AnimationModifier modifier) Retrieves the script for this animation, considering the provided modifier.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
BlueprintAnimation
public BlueprintAnimation(@NotNull @NotNull String name, @NotNull AnimationIterator.Type loop, float length, boolean override, @NotNull @NotNull @Unmodifiable Map<BoneName, BlueprintAnimator> animator, @Nullable @Nullable BlueprintScript script, @NotNull @NotNull TimedStorage<AnimationProgress> emptyAnimator) Creates an instance of aBlueprintAnimationrecord class.- Parameters:
name- the value for thenamerecord componentloop- the value for thelooprecord componentlength- the value for thelengthrecord componentoverride- the value for theoverriderecord componentanimator- the value for theanimatorrecord componentscript- the value for thescriptrecord componentemptyAnimator- the value for theemptyAnimatorrecord component
-
-
Method Details
-
script
Retrieves the script for this animation, considering the provided modifier.If the modifier overrides the animation or specifies a player, the script may be suppressed.
- Parameters:
modifier- the animation modifier- Returns:
- the script, or null if suppressed
- Since:
- 1.15.2
-
emptyIterator
@NotNull public @NotNull AnimationIterator<AnimationProgress> emptyIterator(@NotNull AnimationIterator.Type type) Creates an iterator for the empty animation sequence.- Parameters:
type- the loop type- Returns:
- an animation iterator
- Since:
- 1.15.2
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
loop
Returns the value of thelooprecord component.- Returns:
- the value of the
looprecord component
-
length
public float length()Returns the value of thelengthrecord component.- Returns:
- the value of the
lengthrecord component
-
override
public boolean override()Returns the value of theoverriderecord component.- Returns:
- the value of the
overriderecord component
-
animator
Returns the value of theanimatorrecord component.- Returns:
- the value of the
animatorrecord component
-
script
Returns the value of thescriptrecord component.- Returns:
- the value of the
scriptrecord component
-
emptyAnimator
Returns the value of theemptyAnimatorrecord component.- Returns:
- the value of the
emptyAnimatorrecord component
-