Record Class PackFormat.IntermediaryFormat
java.lang.Object
java.lang.Record
net.minecraft.server.packs.metadata.pack.PackFormat.IntermediaryFormat
- Enclosing class:
PackFormat
public static record PackFormat.IntermediaryFormat(Optional<PackFormat> min, Optional<PackFormat> max, Optional<Integer> format, Optional<InclusiveRange<Integer>> supported)
extends Record
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for theformatrecord component.private final Optional<PackFormat> The field for themaxrecord component.private final Optional<PackFormat> The field for theminrecord component.static final com.mojang.serialization.MapCodec<PackFormat.IntermediaryFormat> static final com.mojang.serialization.MapCodec<PackFormat.IntermediaryFormat> private final Optional<InclusiveRange<Integer>> The field for thesupportedrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionIntermediaryFormat(Optional<PackFormat> min, Optional<PackFormat> max, Optional<Integer> format, Optional<InclusiveRange<Integer>> supported) Creates an instance of aIntermediaryFormatrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintfinal booleanIndicates whether some other object is "equal to" this one.format()Returns the value of theformatrecord component.fromRange(InclusiveRange<PackFormat> range, int lastPreMinorVersion) final inthashCode()Returns a hash code value for this object.max()Returns the value of themaxrecord component.min()Returns the value of theminrecord component.Returns the value of thesupportedrecord component.final StringtoString()Returns a string representation of this record class.com.mojang.serialization.DataResult<InclusiveRange<PackFormat>> validate(int lastPreMinorVersion, boolean hasPackFormatField, boolean requireOldField, String context, String oldFieldName) private com.mojang.serialization.DataResult<InclusiveRange<PackFormat>> validateNewFormat(int lastPreMinorVersion, boolean hasPackFormatField, boolean requireOldField, String context, String oldFieldName) private com.mojang.serialization.DataResult<InclusiveRange<PackFormat>> validateOldFormat(int lastPreMinorVersion, boolean hasPackFormatField, String context, String oldFieldName) private @Nullable StringvalidatePackFormatForRange(int min, int max)
-
Field Details
-
min
The field for theminrecord component. -
max
The field for themaxrecord component. -
format
-
supported
The field for thesupportedrecord component. -
PACK_CODEC
-
OVERLAY_CODEC
-
-
Constructor Details
-
IntermediaryFormat
public IntermediaryFormat(Optional<PackFormat> min, Optional<PackFormat> max, Optional<Integer> format, Optional<InclusiveRange<Integer>> supported) Creates an instance of aIntermediaryFormatrecord class.- Parameters:
min- the value for theminrecord componentmax- the value for themaxrecord componentformat- the value for theformatrecord componentsupported- the value for thesupportedrecord component
-
-
Method Details
-
fromRange
public static PackFormat.IntermediaryFormat fromRange(InclusiveRange<PackFormat> range, int lastPreMinorVersion) -
effectiveMinMajorVersion
public int effectiveMinMajorVersion() -
validate
public com.mojang.serialization.DataResult<InclusiveRange<PackFormat>> validate(int lastPreMinorVersion, boolean hasPackFormatField, boolean requireOldField, String context, String oldFieldName) -
validateNewFormat
private com.mojang.serialization.DataResult<InclusiveRange<PackFormat>> validateNewFormat(int lastPreMinorVersion, boolean hasPackFormatField, boolean requireOldField, String context, String oldFieldName) -
validateOldFormat
private com.mojang.serialization.DataResult<InclusiveRange<PackFormat>> validateOldFormat(int lastPreMinorVersion, boolean hasPackFormatField, String context, String oldFieldName) -
validatePackFormatForRange
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
min
Returns the value of theminrecord component.- Returns:
- the value of the
minrecord component
-
max
Returns the value of themaxrecord component.- Returns:
- the value of the
maxrecord component
-
format
-
supported
Returns the value of thesupportedrecord component.- Returns:
- the value of the
supportedrecord component
-