Package com.plotsquared.core.util
Record Class MinecraftVersion
java.lang.Object
java.lang.Record
com.plotsquared.core.util.MinecraftVersion
- Record Components:
major- the major part of the version string. For versions pre 26 this is the minor version partminor- the minor part of the version string. For versions pre 26 this is the patch version partpatch- the patch part of the version string. For versions pre 26 this is always0
- All Implemented Interfaces:
Comparable<MinecraftVersion>
public record MinecraftVersion(int major, int minor, int patch)
extends Record
implements Comparable<MinecraftVersion>
Represents a Minecraft version. For simplicity, and compatibility with modern versions, the `1.` prefix of older versions is
ignored and the minor version part becomes the major version part.
- `1.17.0` -> `(17, 0, 0)`
- `26.2` -> `(26, 2, 0)`
- `26.1.2` -> `(26, 1, 2)`
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MinecraftVersionMinecraft 1.17 release versionstatic final MinecraftVersionMinecraft 1.18 release versionstatic final MinecraftVersionMinecraft 26.2 release versionstatic final MinecraftVersionMinecraft 1.19 release versionstatic final MinecraftVersionMinecraft 26.1 release versionstatic final MinecraftVersionMinecraft 1.20 release versionstatic final MinecraftVersionMinecraft 1.21 release version -
Constructor Summary
ConstructorsConstructorDescriptionMinecraftVersion(int major, int minor, int patch) Creates an instance of aMinecraftVersionrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(@NotNull MinecraftVersion o) static MinecraftVersioncurrent()final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisNewerOrEqualThan(int otherMajor) booleanisNewerOrEqualThan(int otherMajor, int otherMinor) booleanbooleanisOlderOrEqualThan(int otherMajor) booleanisOlderOrEqualThan(int otherMajor, int otherMinor) booleanbooleanisOlderThan(MinecraftVersion other) intmajor()Returns the value of themajorrecord component.intminor()Returns the value of theminorrecord component.intpatch()Returns the value of thepatchrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CAVES_AND_CLIFFS
Minecraft 1.17 release version -
CAVES_AND_CLIFFS_2
Minecraft 1.18 release version -
THE_WILD_UPDATE
Minecraft 1.19 release version -
TRAILS_AND_TALES
Minecraft 1.20 release version -
TRICKY_TRIALS
Minecraft 1.21 release version -
TINY_TAKEOVER
Minecraft 26.1 release version -
CHAOS_CUBED
Minecraft 26.2 release version
-
-
Constructor Details
-
Method Details
-
current
-
compareTo
- Specified by:
compareToin interfaceComparable<MinecraftVersion>
-
isNewerOrEqualThan
-
isOlderOrEqualThan
-
isOlderThan
-
isNewerOrEqualThan
-
isNewerOrEqualThan
-
isOlderOrEqualThan
-
isOlderOrEqualThan
-
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
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
Returns the value of themajorrecord component.- Returns:
- the value of the
majorrecord component
-
minor
Returns the value of theminorrecord component.- Returns:
- the value of the
minorrecord component
-
patch
Returns the value of thepatchrecord component.- Returns:
- the value of the
patchrecord component
-