Class McVersion
java.lang.Object
me.devnatan.inventoryframework.runtime.thirdparty.McVersion
- All Implemented Interfaces:
Comparable<McVersion>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintstatic McVersioncurrent()Gets the currently running McVersionbooleanintgetMajor()Gets the "major" part of this McVersion.intgetMinor()Gets the "minor" part of this McVersion.getName()intgetPatch()Gets the "patch" part of this McVersion.inthashCode()booleanisAtLeast(int major, int minor) booleanisAtLeast(int major, int minor, int patch) booleanstatic booleansupports(int minorNumber) Checks whether the server version is equal or greater than the given version.static booleansupports(int minorNumber, int patchNumber) Checks whether the server version is equal or greater than the given version.toString()
-
Constructor Details
-
McVersion
public McVersion(int major, int minor) -
McVersion
public McVersion(int major, int minor, int patch)
-
-
Method Details
-
current
Gets the currently running McVersion -
isAtLeast
-
compareTo
- Specified by:
compareToin interfaceComparable<McVersion>
-
getMajor
public int getMajor()Gets the "major" part of this McVersion. For 1.16.5, this would be 1 -
getMinor
public int getMinor()Gets the "minor" part of this McVersion. For 1.16.5, this would be 16 -
getPatch
public int getPatch()Gets the "patch" part of this McVersion. For 1.16.5, this would be 5. -
hashCode
public int hashCode() -
equals
-
toString
-
getName
-
isAtLeast
public boolean isAtLeast(int major, int minor, int patch) -
isAtLeast
public boolean isAtLeast(int major, int minor) -
supports
public static boolean supports(int minorNumber) Checks whether the server version is equal or greater than the given version.- Parameters:
minorNumber- the version to compare the server version with.- Returns:
- true if the version is equal or newer, otherwise false.
- Since:
- 4.0.0
- See Also:
-
supports
public static boolean supports(int minorNumber, int patchNumber) Checks whether the server version is equal or greater than the given version.- Parameters:
minorNumber- the version to compare the server version with.patchNumber- the version to compare the server version with.- Returns:
- true if the version is equal or newer, otherwise false.
- Since:
- 4.0.0
- See Also:
-