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
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<PackMetadataSection> private final ComponentThe field for thedescriptionrecord component.private final intThe field for thepackFormatrecord component.private final Optional<InclusiveRange<Integer>> The field for thesupportedFormatsrecord component.static final MetadataSectionType<PackMetadataSection> -
Constructor Summary
ConstructorsConstructorDescriptionPackMetadataSection(Component description, int packVersion) PackMetadataSection(Component description, int packFormat, Optional<InclusiveRange<Integer>> supportedFormats) Creates an instance of aPackMetadataSectionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intReturns the value of thepackFormatrecord component.Returns the value of thesupportedFormatsrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
description
The field for thedescriptionrecord component. -
packFormat
private final int packFormatThe field for thepackFormatrecord component. -
supportedFormats
The field for thesupportedFormatsrecord component. -
CODEC
-
TYPE
-
-
Constructor Details
-
PackMetadataSection
-
PackMetadataSection
public PackMetadataSection(Component description, int packFormat, Optional<InclusiveRange<Integer>> supportedFormats) Creates an instance of aPackMetadataSectionrecord class.- Parameters:
description- the value for thedescriptionrecord componentpackFormat- the value for thepackFormatrecord componentsupportedFormats- the value for thesupportedFormatsrecord 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 thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
packFormat
public int packFormat()Returns the value of thepackFormatrecord component.- Returns:
- the value of the
packFormatrecord component
-
supportedFormats
Returns the value of thesupportedFormatsrecord component.- Returns:
- the value of the
supportedFormatsrecord component
-