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 other) final booleanIndicates whether some other object is "equal to" this one.private static com.mojang.serialization.Codec<PackFormat> fullCodec(int defaultMinor) final inthashCode()Returns a hash code value for this object.static intlastPreMinorVersion(PackType type) intmajor()Returns the value of themajorrecord component.intminor()Returns the value of theminorrecord component.static PackFormatof(int major) static PackFormatof(int major, int minor) 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> list, int lastPreMinorVersion, BiFunction<HolderType, InclusiveRange<PackFormat>, ResultType> constructor)
-
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> list, int lastPreMinorVersion, BiFunction<HolderType, InclusiveRange<PackFormat>, ResultType> constructor) -
lastPreMinorVersion
-
packCodec
public static com.mojang.serialization.MapCodec<InclusiveRange<PackFormat>> packCodec(PackType type) -
of
-
of
-
minorRange
-
compareTo
- Specified by:
compareToin interfaceComparable<PackFormat>
-
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 with thecomparemethod from their corresponding wrapper classes. -
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
-