Class MinecraftVersion
java.lang.Object
com.fastasyncworldedit.bukkit.util.MinecraftVersion
- All Implemented Interfaces:
Comparable<MinecraftVersion>
Utility class for retrieving and comparing minecraft server versions.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final MinecraftVersion
static final MinecraftVersion
static final MinecraftVersion
-
Constructor Summary
ConstructorDescriptionDeprecated, for removal: This API element is subject to removal in a future version.MinecraftVersion
(int major, int minor) Construct a new version with major and minor version.MinecraftVersion
(int major, int minor, int release) Construct a new version with major, minor and release version. -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(MinecraftVersion other) boolean
static MinecraftVersion
Get the minecraft version that the server is currently runningint
getMajor()
int
getMinor()
int
boolean
isEqual
(MinecraftVersion other) boolean
boolean
boolean
isHigherThan
(MinecraftVersion other) boolean
isLowerThan
(MinecraftVersion other) toString()
-
Field Details
-
NETHER
-
CAVES_17
-
CAVES_18
-
-
Constructor Details
-
MinecraftVersion
public MinecraftVersion(int major, int minor, int release) Construct a new version with major, minor and release version.- Parameters:
major
- Major part of the version, only1
would make sense.minor
- Minor part, full updates, e.g. Nether & Caves & Cliffsrelease
- Release, changes for the server software during a minor update.
-
MinecraftVersion
public MinecraftVersion(int major, int minor) Construct a new version with major and minor version. The release version is set to 0, therefore ignored.- See Also:
-
MinecraftVersion
Deprecated, for removal: This API element is subject to removal in a future version.usegetCurrent()
instead.Construct a new version with major, minor and release based on the server version.
-
-
Method Details
-
getCurrent
Get the minecraft version that the server is currently running- Since:
- 2.1.0
-
isEqual
- Parameters:
other
- The other version to compare against.- Returns:
true
if this version is equal to the other version.
-
isEqualOrHigherThan
- Parameters:
other
- The other version to compare against.- Returns:
true
if this version is higher or equal compared to the other version.
-
isEqualOrLowerThan
- Parameters:
other
- The other version to compare against.- Returns:
true
if this version is lower or equal compared to the other version.
-
isHigherThan
- Parameters:
other
- The other version to compare against.- Returns:
true
if this version is higher than the other version.
-
isLowerThan
- Parameters:
other
- The other version to compare against.- Returns:
true
if this version is lower than to the other version.
-
getMajor
public int getMajor() -
getMinor
public int getMinor() -
getRelease
public int getRelease() -
compareTo
- Specified by:
compareTo
in interfaceComparable<MinecraftVersion>
-
equals
-
toString
-
getCurrent()
instead.