Package net.okocraft.box.api.util
Record Class MCDataVersion
java.lang.Object
java.lang.Record
net.okocraft.box.api.util.MCDataVersion
- Record Components:
dataVersion- the data version (Minecraft Wiki: Data version)
- All Implemented Interfaces:
Comparable<MCDataVersion>,Version<MCDataVersion>
A class to get/compare Minecraft versions based on data version.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MCDataVersionAMCDataVersionthat represents Minecraft 1.17static final MCDataVersionAMCDataVersionthat represents Minecraft 1.17.1static final MCDataVersionAMCDataVersionthat represents Minecraft 1.18static final MCDataVersionAMCDataVersionthat represents Minecraft 1.18.1static final MCDataVersionAMCDataVersionthat represents Minecraft 1.18.2static final MCDataVersionAMCDataVersionthat represents Minecraft 1.19static final MCDataVersionAMCDataVersionthat represents Minecraft 1.19.1static final MCDataVersionAMCDataVersionthat represents Minecraft 1.19.2static final MCDataVersionAMCDataVersionthat represents Minecraft 1.19.3static final MCDataVersionAMCDataVersionthat represents Minecraft 1.19.4static final MCDataVersionAMCDataVersionthat represents Minecraft 1.20static final MCDataVersionAMCDataVersionthat represents Minecraft 1.20.1static final MCDataVersionAMCDataVersionthat represents Minecraft 1.20.2static final MCDataVersionAMCDataVersionthat represents Minecraft 1.20.3static final MCDataVersionAMCDataVersionthat represents Minecraft 1.20.4static final MCDataVersionAMCDataVersionthat represents Minecraft 1.20.5static final MCDataVersionAMCDataVersionthat represents Minecraft 1.20.6static final MCDataVersionAMCDataVersionthat represents Minecraft 1.21static final MCDataVersionAMCDataVersionthat represents Minecraft 1.21.1static final MCDataVersionAMCDataVersionthat represents Minecraft 1.21.2static final MCDataVersionAMCDataVersionthat represents Minecraft 1.21.3static final MCDataVersionAMCDataVersionthat represents Minecraft 1.21.4 -
Constructor Summary
ConstructorsConstructorDescriptionMCDataVersion(int dataVersion) Creates an instance of aMCDataVersionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(@NotNull MCDataVersion other) static @NotNull MCDataVersioncurrent()GetsMCDataVersionof the server on which Box is currently running.intReturns the value of thedataVersionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static @NotNull MCDataVersionof(int dataVersion) Creates aMCDataVersionfrom the specified data versionfinal StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.okocraft.box.api.util.Version
isAfter, isAfterOrSame, isBefore, isBeforeOrSame, isBetween, isSame
-
Field Details
-
MC_1_17
AMCDataVersionthat represents Minecraft 1.17 -
MC_1_17_1
AMCDataVersionthat represents Minecraft 1.17.1 -
MC_1_18
AMCDataVersionthat represents Minecraft 1.18 -
MC_1_18_1
AMCDataVersionthat represents Minecraft 1.18.1 -
MC_1_18_2
AMCDataVersionthat represents Minecraft 1.18.2 -
MC_1_19
AMCDataVersionthat represents Minecraft 1.19 -
MC_1_19_1
AMCDataVersionthat represents Minecraft 1.19.1 -
MC_1_19_2
AMCDataVersionthat represents Minecraft 1.19.2 -
MC_1_19_3
AMCDataVersionthat represents Minecraft 1.19.3 -
MC_1_19_4
AMCDataVersionthat represents Minecraft 1.19.4 -
MC_1_20
AMCDataVersionthat represents Minecraft 1.20 -
MC_1_20_1
AMCDataVersionthat represents Minecraft 1.20.1 -
MC_1_20_2
AMCDataVersionthat represents Minecraft 1.20.2 -
MC_1_20_3
AMCDataVersionthat represents Minecraft 1.20.3 -
MC_1_20_4
AMCDataVersionthat represents Minecraft 1.20.4 -
MC_1_20_5
AMCDataVersionthat represents Minecraft 1.20.5 -
MC_1_20_6
AMCDataVersionthat represents Minecraft 1.20.6 -
MC_1_21
AMCDataVersionthat represents Minecraft 1.21 -
MC_1_21_1
AMCDataVersionthat represents Minecraft 1.21.1 -
MC_1_21_2
AMCDataVersionthat represents Minecraft 1.21.2 -
MC_1_21_3
AMCDataVersionthat represents Minecraft 1.21.3 -
MC_1_21_4
AMCDataVersionthat represents Minecraft 1.21.4
-
-
Constructor Details
-
MCDataVersion
public MCDataVersion(int dataVersion) Creates an instance of aMCDataVersionrecord class.- Parameters:
dataVersion- the value for thedataVersionrecord component
-
-
Method Details
-
of
Creates aMCDataVersionfrom the specified data version- Parameters:
dataVersion- the data version- Returns:
- a
MCDataVersion
-
current
GetsMCDataVersionof the server on which Box is currently running.- Returns:
MCDataVersionof the server on which Box is currently running
-
compareTo
- Specified by:
compareToin interfaceComparable<MCDataVersion>
-
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 '=='. -
dataVersion
public int dataVersion()Returns the value of thedataVersionrecord component.- Returns:
- the value of the
dataVersionrecord component
-