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
Modifier and TypeFieldDescriptionstatic final MCDataVersion
AMCDataVersion
that represents Minecraft 1.17static final MCDataVersion
AMCDataVersion
that represents Minecraft 1.17.1static final MCDataVersion
AMCDataVersion
that represents Minecraft 1.18static final MCDataVersion
AMCDataVersion
that represents Minecraft 1.18.1static final MCDataVersion
AMCDataVersion
that represents Minecraft 1.18.2static final MCDataVersion
AMCDataVersion
that represents Minecraft 1.19static final MCDataVersion
AMCDataVersion
that represents Minecraft 1.19.1static final MCDataVersion
AMCDataVersion
that represents Minecraft 1.19.2static final MCDataVersion
AMCDataVersion
that represents Minecraft 1.19.3static final MCDataVersion
AMCDataVersion
that represents Minecraft 1.19.4static final MCDataVersion
AMCDataVersion
that represents Minecraft 1.20static final MCDataVersion
AMCDataVersion
that represents Minecraft 1.20.1static final MCDataVersion
AMCDataVersion
that represents Minecraft 1.20.2static final MCDataVersion
AMCDataVersion
that represents Minecraft 1.20.3static final MCDataVersion
AMCDataVersion
that represents Minecraft 1.20.4static final MCDataVersion
AMCDataVersion
that represents Minecraft 1.20.5static final MCDataVersion
AMCDataVersion
that represents Minecraft 1.20.6static final MCDataVersion
AMCDataVersion
that represents Minecraft 1.21static final MCDataVersion
AMCDataVersion
that represents Minecraft 1.21.1 -
Constructor Summary
ConstructorDescriptionMCDataVersion
(int dataVersion) Creates an instance of aMCDataVersion
record class. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(@NotNull MCDataVersion other) static @NotNull MCDataVersion
current()
GetsMCDataVersion
of the server on which Box is currently running.int
Returns the value of thedataVersion
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.static @NotNull MCDataVersion
of
(int dataVersion) Creates aMCDataVersion
from the specified data versionfinal String
toString()
Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.okocraft.box.api.util.Version
isAfter, isAfterOrSame, isBefore, isBeforeOrSame, isBetween, isSame
-
Field Details
-
MC_1_17
AMCDataVersion
that represents Minecraft 1.17 -
MC_1_17_1
AMCDataVersion
that represents Minecraft 1.17.1 -
MC_1_18
AMCDataVersion
that represents Minecraft 1.18 -
MC_1_18_1
AMCDataVersion
that represents Minecraft 1.18.1 -
MC_1_18_2
AMCDataVersion
that represents Minecraft 1.18.2 -
MC_1_19
AMCDataVersion
that represents Minecraft 1.19 -
MC_1_19_1
AMCDataVersion
that represents Minecraft 1.19.1 -
MC_1_19_2
AMCDataVersion
that represents Minecraft 1.19.2 -
MC_1_19_3
AMCDataVersion
that represents Minecraft 1.19.3 -
MC_1_19_4
AMCDataVersion
that represents Minecraft 1.19.4 -
MC_1_20
AMCDataVersion
that represents Minecraft 1.20 -
MC_1_20_1
AMCDataVersion
that represents Minecraft 1.20.1 -
MC_1_20_2
AMCDataVersion
that represents Minecraft 1.20.2 -
MC_1_20_3
AMCDataVersion
that represents Minecraft 1.20.3 -
MC_1_20_4
AMCDataVersion
that represents Minecraft 1.20.4 -
MC_1_20_5
AMCDataVersion
that represents Minecraft 1.20.5 -
MC_1_20_6
AMCDataVersion
that represents Minecraft 1.20.6 -
MC_1_21
AMCDataVersion
that represents Minecraft 1.21 -
MC_1_21_1
AMCDataVersion
that represents Minecraft 1.21.1
-
-
Constructor Details
-
MCDataVersion
public MCDataVersion(int dataVersion) Creates an instance of aMCDataVersion
record class.- Parameters:
dataVersion
- the value for thedataVersion
record component
-
-
Method Details
-
of
Creates aMCDataVersion
from the specified data version- Parameters:
dataVersion
- the data version- Returns:
- a
MCDataVersion
-
current
GetsMCDataVersion
of the server on which Box is currently running.- Returns:
MCDataVersion
of the server on which Box is currently running
-
compareTo
- Specified by:
compareTo
in 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 thedataVersion
record component.- Returns:
- the value of the
dataVersion
record component
-