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 pWidth, int pHeight) 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
The field for theframeWidthrecord component. -
frameHeight
The field for theframeHeightrecord component. -
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
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 '=='. -
frames
Returns the value of theframesrecord component.- Returns:
- the value of the
framesrecord component
-
frameWidth
Returns the value of theframeWidthrecord component.- Returns:
- the value of the
frameWidthrecord component
-
frameHeight
Returns the value of theframeHeightrecord component.- Returns:
- the value of the
frameHeightrecord component
-
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
-