Record Class PackMetadataSection
java.lang.Object
java.lang.Record
net.minecraft.server.packs.metadata.pack.PackMetadataSection
public record PackMetadataSection(Component description, int packFormat, Optional<InclusiveRange<Integer>> supportedFormats)
extends Record
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<PackMetadataSection> private final Component
The field for thedescription
record component.private final int
The field for thepackFormat
record component.private final Optional
<InclusiveRange<Integer>> The field for thesupportedFormats
record component.static final MetadataSectionType
<PackMetadataSection> -
Constructor Summary
ConstructorDescriptionPackMetadataSection
(Component description, int packFormat, Optional<InclusiveRange<Integer>> supportedFormats) Creates an instance of aPackMetadataSection
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedescription
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
Returns the value of thepackFormat
record component.Returns the value of thesupportedFormats
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
description
The field for thedescription
record component. -
packFormat
private final int packFormatThe field for thepackFormat
record component. -
supportedFormats
The field for thesupportedFormats
record component. -
CODEC
-
TYPE
-
-
Constructor Details
-
PackMetadataSection
public PackMetadataSection(Component description, int packFormat, Optional<InclusiveRange<Integer>> supportedFormats) Creates an instance of aPackMetadataSection
record class.- Parameters:
description
- the value for thedescription
record componentpackFormat
- the value for thepackFormat
record componentsupportedFormats
- the value for thesupportedFormats
record component
-
-
Method Details
-
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 '=='. -
description
Returns the value of thedescription
record component.- Returns:
- the value of the
description
record component
-
packFormat
public int packFormat()Returns the value of thepackFormat
record component.- Returns:
- the value of the
packFormat
record component
-
supportedFormats
Returns the value of thesupportedFormats
record component.- Returns:
- the value of the
supportedFormats
record component
-