Package net.pinger.disguise.server
Class MinecraftServer
java.lang.Object
net.pinger.disguise.server.MinecraftServer
- All Implemented Interfaces:
Comparable<MinecraftServer>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic MinecraftServerReturns the wrapper of the currentMinecraftServerversionstatic PatternA pattern for extraction ofMinecraftServerversions -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanThis method checks if the current server version is greater or equal to the specified version.static booleanatLeast(MinecraftServer otherServer)This method checks if the current server version is greater or equal to the specified version by comparing the twoMinecraftServerreferences.intstatic MinecraftServerfromRaw()This method creates a new instance of this class by using theBukkit.getVersion()version.static MinecraftServerThis method creates a new instance of this class by using the rawVersion from the BukkitAPI.This method returns the version of this minecraft server.static booleanThis method checks if the current server version is equal to the specified version.toString()
-
Field Details
-
VERSION_PATTERN
A pattern for extraction ofMinecraftServerversions -
CURRENT
Returns the wrapper of the currentMinecraftServerversion
-
-
Constructor Details
-
MinecraftServer
-
-
Method Details
-
fromRaw
This method creates a new instance of this class by using the rawVersion from the BukkitAPI.- Parameters:
rawVersion- the rawVersion- Returns:
- the new instance
-
fromRaw
This method creates a new instance of this class by using theBukkit.getVersion()version.- Returns:
- the new instance
-
isVersion
This method checks if the current server version is equal to the specified version.Note that the specified string should be split, not given by the raw value. For example: 1.7.10, 1.8.8
- Parameters:
otherVersion- the version to compare to- Returns:
- if the server version is equal to the specified one
-
atLeast
This method checks if the current server version is greater or equal to the specified version by comparing the twoMinecraftServerreferences.- Parameters:
otherServer- the specified server version- Returns:
- the compared value
-
atLeast
This method checks if the current server version is greater or equal to the specified version.- Parameters:
otherVersion- the specified version- Returns:
- the compared value
-
getVersion
This method returns the version of this minecraft server.- Returns:
- the version
-
compareTo
- Specified by:
compareToin interfaceComparable<MinecraftServer>
-
toString
-