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> pRange, int pVersionThreshold) 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 pVersionThreshold, boolean pRequireOldFormat, boolean pRequireNewFormat, String pContextLabel, String pOldFormatsKey) private com.mojang.serialization.DataResult<InclusiveRange<PackFormat>> validateNewFormat(int pVersionThreshold, boolean pRequireOldFormat, boolean pRequireNewFormat, String pContextLabel, String pOldFormatsKey) private com.mojang.serialization.DataResult<InclusiveRange<PackFormat>> validateOldFormat(int pVersionThreshold, boolean pRequireOldFormat, String pContextLabel, String pOldFormatsKey) private @Nullable StringvalidatePackFormatForRange(int pMin, int pMax)
-
Field Details
-
min
The field for theminrecord component. -
max
The field for themaxrecord component. -
format
The field for theformatrecord component. -
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> pRange, int pVersionThreshold) -
effectiveMinMajorVersion
public int effectiveMinMajorVersion() -
validate
public com.mojang.serialization.DataResult<InclusiveRange<PackFormat>> validate(int pVersionThreshold, boolean pRequireOldFormat, boolean pRequireNewFormat, String pContextLabel, String pOldFormatsKey) -
validateNewFormat
private com.mojang.serialization.DataResult<InclusiveRange<PackFormat>> validateNewFormat(int pVersionThreshold, boolean pRequireOldFormat, boolean pRequireNewFormat, String pContextLabel, String pOldFormatsKey) -
validateOldFormat
private com.mojang.serialization.DataResult<InclusiveRange<PackFormat>> validateOldFormat(int pVersionThreshold, boolean pRequireOldFormat, String pContextLabel, String pOldFormatsKey) -
validatePackFormatForRange
-
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. 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
Returns the value of theformatrecord component.- Returns:
- the value of the
formatrecord component
-
supported
Returns the value of thesupportedrecord component.- Returns:
- the value of the
supportedrecord component
-