Record Class PackFormat
java.lang.Object
java.lang.Record
net.minecraft.server.packs.metadata.pack.PackFormat
- All Implemented Interfaces:
Comparable<PackFormat>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic interface -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<PackFormat> private static final org.slf4j.Loggerprivate final intThe field for themajorrecord component.private final intThe field for theminorrecord component.static final com.mojang.serialization.Codec<PackFormat> -
Constructor Summary
ConstructorsConstructorDescriptionPackFormat(int major, int minor) Creates an instance of aPackFormatrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(PackFormat pOther) final booleanIndicates whether some other object is "equal to" this one.private static com.mojang.serialization.Codec<PackFormat> fullCodec(int pDefaultMinorVersion) final inthashCode()Returns a hash code value for this object.static intlastPreMinorVersion(PackType pType) intmajor()Returns the value of themajorrecord component.intminor()Returns the value of theminorrecord component.static PackFormatof(int pMajor) static PackFormatof(int pMajor, int pMinor) static com.mojang.serialization.MapCodec<InclusiveRange<PackFormat>> toString()Returns a string representation of this record class.static <ResultType,HolderType extends PackFormat.IntermediaryFormatHolder>
com.mojang.serialization.DataResult<List<ResultType>> validateHolderList(List<HolderType> pHolderList, int pVersionThreshold, BiFunction<HolderType, InclusiveRange<PackFormat>, ResultType> pMapper)
-
Field Details
-
major
private final int majorThe field for themajorrecord component. -
minor
private final int minorThe field for theminorrecord component. -
LOGGER
private static final org.slf4j.Logger LOGGER -
BOTTOM_CODEC
-
TOP_CODEC
-
-
Constructor Details
-
PackFormat
public PackFormat(int major, int minor) Creates an instance of aPackFormatrecord class.- Parameters:
major- the value for themajorrecord componentminor- the value for theminorrecord component
-
-
Method Details
-
fullCodec
-
validateHolderList
public static <ResultType,HolderType extends PackFormat.IntermediaryFormatHolder> com.mojang.serialization.DataResult<List<ResultType>> validateHolderList(List<HolderType> pHolderList, int pVersionThreshold, BiFunction<HolderType, InclusiveRange<PackFormat>, ResultType> pMapper) -
lastPreMinorVersion
-
packCodec
public static com.mojang.serialization.MapCodec<InclusiveRange<PackFormat>> packCodec(PackType pPackType) -
of
-
of
-
minorRange
-
compareTo
- Specified by:
compareToin interfaceComparable<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. All components in this record class are compared with '=='. -
major
public int major()Returns the value of themajorrecord component.- Returns:
- the value of the
majorrecord component
-
minor
public int minor()Returns the value of theminorrecord component.- Returns:
- the value of the
minorrecord component
-