Record Class AnimationMetadataSection
java.lang.Object
java.lang.Record
net.minecraft.client.resources.metadata.animation.AnimationMetadataSection
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<AnimationMetadataSection> private final intThe field for thedefaultFrameTimerecord component.The field for theframeHeightrecord component.private final Optional<List<AnimationFrame>> The field for theframesrecord component.The field for theframeWidthrecord component.private final booleanThe field for theinterpolatedFramesrecord component.static final MetadataSectionType<AnimationMetadataSection> -
Constructor Summary
ConstructorsConstructorDescriptionAnimationMetadataSection(Optional<List<AnimationFrame>> frames, Optional<Integer> frameWidth, Optional<Integer> frameHeight, int defaultFrameTime, boolean interpolatedFrames) Creates an instance of aAnimationMetadataSectionrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncalculateFrameSize(int spriteWidth, int spriteHeight) intReturns the value of thedefaultFrameTimerecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theframeHeightrecord component.frames()Returns the value of theframesrecord component.Returns the value of theframeWidthrecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of theinterpolatedFramesrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
frames
The field for theframesrecord component. -
frameWidth
-
frameHeight
-
defaultFrameTime
private final int defaultFrameTimeThe field for thedefaultFrameTimerecord component. -
interpolatedFrames
private final boolean interpolatedFramesThe field for theinterpolatedFramesrecord component. -
CODEC
-
TYPE
-
-
Constructor Details
-
AnimationMetadataSection
public AnimationMetadataSection(Optional<List<AnimationFrame>> frames, Optional<Integer> frameWidth, Optional<Integer> frameHeight, int defaultFrameTime, boolean interpolatedFrames) Creates an instance of aAnimationMetadataSectionrecord class.- Parameters:
frames- the value for theframesrecord componentframeWidth- the value for theframeWidthrecord componentframeHeight- the value for theframeHeightrecord componentdefaultFrameTime- the value for thedefaultFrameTimerecord componentinterpolatedFrames- the value for theinterpolatedFramesrecord component
-
-
Method Details
-
calculateFrameSize
-
toString
-
hashCode
-
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 thecomparemethod from their corresponding wrapper classes. -
frames
Returns the value of theframesrecord component.- Returns:
- the value of the
framesrecord component
-
frameWidth
-
frameHeight
-
defaultFrameTime
public int defaultFrameTime()Returns the value of thedefaultFrameTimerecord component.- Returns:
- the value of the
defaultFrameTimerecord component
-
interpolatedFrames
public boolean interpolatedFrames()Returns the value of theinterpolatedFramesrecord component.- Returns:
- the value of the
interpolatedFramesrecord component
-