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, Optional<PackMetadataSection.NeoForgeData> neoForgeData)
extends Record
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<PackMetadataSection>
private final Component
The field for thedescription
record component.private final Optional<PackMetadataSection.NeoForgeData>
The field for theneoForgeData
record component.private final int
Deprecated.private final Optional<InclusiveRange<Integer>>
The field for thesupportedFormats
record component.static final MetadataSectionType<PackMetadataSection>
-
Constructor Summary
ConstructorDescriptionPackMetadataSection
(Component description, int packVersion) PackMetadataSection
(Component p_10371_, int p_10372_, Map<PackType, Integer> packTypeVersions) PackMetadataSection
(Component description, int packFormat, Optional<InclusiveRange<Integer>> supportedFormats) Deprecated.PackMetadataSection
(Component description, int packFormat, Optional<InclusiveRange<Integer>> supportedFormats, Optional<PackMetadataSection.NeoForgeData> neoForgeData) Creates an instance of aPackMetadataSection
record class.PackMetadataSection
(Component description, int packFormat, PackMetadataSection.NeoForgeData neoForgeData) PackMetadataSection
(Component description, int packFormat, InclusiveRange<Integer> supportedFormats) -
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.Returns the value of theneoForgeData
record component.int
Deprecated.int
packFormat
(PackType packType) 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
Deprecated.The field for thepackFormat
record component. -
supportedFormats
The field for thesupportedFormats
record component. -
neoForgeData
The field for theneoForgeData
record component. -
CODEC
-
TYPE
-
-
Constructor Details
-
PackMetadataSection
@Deprecated public PackMetadataSection(Component description, int packFormat, Optional<InclusiveRange<Integer>> supportedFormats) Deprecated. -
PackMetadataSection
public PackMetadataSection(Component description, int packFormat, InclusiveRange<Integer> supportedFormats) -
PackMetadataSection
public PackMetadataSection(Component description, int packFormat, PackMetadataSection.NeoForgeData neoForgeData) -
PackMetadataSection
-
PackMetadataSection
-
PackMetadataSection
public PackMetadataSection(Component description, @Deprecated int packFormat, Optional<InclusiveRange<Integer>> supportedFormats, Optional<PackMetadataSection.NeoForgeData> neoForgeData) 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 componentneoForgeData
- the value for theneoForgeData
record component
-
-
Method Details
-
packFormat
-
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
Deprecated.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
-
neoForgeData
Returns the value of theneoForgeData
record component.- Returns:
- the value of the
neoForgeData
record component
-