Package kr.toxicity.model.api.data.raw
Record Class ModelAnimation
java.lang.Object
java.lang.Record
kr.toxicity.model.api.data.raw.ModelAnimation
- Record Components:
name- the name of the animationloop- the loop mode (e.g., play_once, loop, hold)override- whether this animation should override othersuuid- the unique identifier of the animationlength- the total length of the animation in secondsanimators- a map of animators, keyed by the UUID of the bone group they affect
@Internal
public record ModelAnimation(@NotNull String name, AnimationIterator.Type loop, boolean override, @NotNull String uuid, float length, @Nullable Map<String,ModelAnimator> animators)
extends Record
Represents a raw animation definition from a model file.
This record holds the properties of an animation, such as its name, length, loop mode, and the animators that define the keyframes for each bone group.
- Since:
- 1.15.2
-
Constructor Summary
ConstructorsConstructorDescriptionModelAnimation(@NotNull String name, AnimationIterator.Type loop, boolean override, @NotNull String uuid, float length, @Nullable Map<String, ModelAnimator> animators) Creates an instance of aModelAnimationrecord class. -
Method Summary
Modifier and TypeMethodDescription@NotNull Map<String, ModelAnimator> Returns the map of animators for this animation.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 loop mode of the animation.@NotNull Stringname()Returns the value of thenamerecord component.booleanoverride()Returns the value of theoverriderecord component.@NotNull BlueprintAnimationtoBlueprint(@NotNull ModelLoadContext context, @NotNull List<BlueprintElement> children) Converts this raw animation data into a processedBlueprintAnimation.final StringtoString()Returns a string representation of this record class.@NotNull Stringuuid()Returns the value of theuuidrecord component.
-
Constructor Details
-
ModelAnimation
public ModelAnimation(@NotNull @NotNull String name, @Nullable AnimationIterator.Type loop, boolean override, @NotNull @NotNull String uuid, float length, @Nullable @Nullable Map<String, ModelAnimator> animators) Creates an instance of aModelAnimationrecord class.- Parameters:
name- the value for thenamerecord componentloop- the value for thelooprecord componentoverride- the value for theoverriderecord componentuuid- the value for theuuidrecord componentlength- the value for thelengthrecord componentanimators- the value for theanimatorsrecord component
-
-
Method Details
-
toBlueprint
@NotNull public @NotNull BlueprintAnimation toBlueprint(@NotNull @NotNull ModelLoadContext context, @NotNull @NotNull List<BlueprintElement> children) Converts this raw animation data into a processedBlueprintAnimation.- Parameters:
context- the model loading contextchildren- the list of root blueprint elements- Returns:
- the blueprint animation
- Since:
- 1.15.2
-
loop
Returns the loop mode of the animation.- Returns:
- the loop mode, defaulting to
AnimationIterator.Type.PLAY_ONCEif null - Since:
- 1.15.2
-
animators
Returns the map of animators for this animation.- Returns:
- the animators, or an empty map if null
- 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
-
override
public boolean override()Returns the value of theoverriderecord component.- Returns:
- the value of the
overriderecord component
-
uuid
Returns the value of theuuidrecord component.- Returns:
- the value of the
uuidrecord component
-
length
public float length()Returns the value of thelengthrecord component.- Returns:
- the value of the
lengthrecord component
-