Class Version
- java.lang.Object
-
- com.github.crashdemons.playerheads.compatibility.Version
-
public final class Version extends Object
A class providing methods related to the current server's version.- Author:
- crashdemons (crashenator at gmail.com)
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static booleancheckAtLeast(int major, int minor)Checks whether the current server version is at least the version suppliedstatic booleancheckEquals(int major, int minor)Checks whether the current server version is exactly the version suppliedstatic booleancheckUnder(int major, int minor)Checks whether the current server version is less than the version suppliedstatic StringgetBukkitClassVersion()Gets the raw version string for NMS and OBC class pathsstatic StringgetRawServerVersion()Gets the raw version string supplied by the serverstatic StringgetString()Gets the detected server version string in the format Major.Minorstatic StringgetType()The type of server.static voidinit()Initialize the version class and detect the server version.static voidsetDetectedServerVersion(String type, int major, int minor)Deprecated.internal use only
-
-
-
Method Detail
-
checkAtLeast
public static boolean checkAtLeast(int major, int minor)Checks whether the current server version is at least the version supplied- Parameters:
major- the major version number to checkminor- the minor version number to check- Returns:
- whether the check is true
-
checkUnder
public static boolean checkUnder(int major, int minor)Checks whether the current server version is less than the version supplied- Parameters:
major- the major version number to checkminor- the minor version number to check- Returns:
- whether the check is true
-
checkEquals
public static boolean checkEquals(int major, int minor)Checks whether the current server version is exactly the version supplied- Parameters:
major- the major version number to checkminor- the minor version number to check- Returns:
- whether the check is true
-
getRawServerVersion
public static String getRawServerVersion()
Gets the raw version string supplied by the server- Returns:
- the version string
-
getBukkitClassVersion
public static String getBukkitClassVersion()
Gets the raw version string for NMS and OBC class paths- Returns:
- The version string of OBC and NMS packages
-
getString
public static String getString()
Gets the detected server version string in the format Major.Minor- Returns:
- the version string
-
getType
public static String getType()
The type of server.- Returns:
- the server type string
-
init
public static void init() throws UnknownVersionException, CompatibilityUnsupportedExceptionInitialize the version class and detect the server version.- Throws:
UnknownVersionException- If the version string supplied by the server could not be understood.CompatibilityUnsupportedException- If the version supplied by the server is not supportable by this plugin
-
setDetectedServerVersion
@Deprecated public static void setDetectedServerVersion(String type, int major, int minor)
Deprecated.internal use onlyInternal method used for testing only.- Parameters:
type- server type stringmajor- major version numberminor- minor version number
-
-