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
FieldsModifier and TypeFieldDescriptionstatic final MinecraftVersionstatic final MinecraftVersionstatic final MinecraftVersion -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated, 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 TypeMethodDescriptionintcompareTo(MinecraftVersion other) booleanstatic MinecraftVersionGet the minecraft version that the server is currently runningintgetMajor()intgetMinor()intbooleanisEqual(MinecraftVersion other) booleanbooleanbooleanisHigherThan(MinecraftVersion other) booleanisLowerThan(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, only1would 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:
trueif this version is equal to the other version.
-
isEqualOrHigherThan
- Parameters:
other- The other version to compare against.- Returns:
trueif this version is higher or equal compared to the other version.
-
isEqualOrLowerThan
- Parameters:
other- The other version to compare against.- Returns:
trueif this version is lower or equal compared to the other version.
-
isHigherThan
- Parameters:
other- The other version to compare against.- Returns:
trueif this version is higher than the other version.
-
isLowerThan
- Parameters:
other- The other version to compare against.- Returns:
trueif this version is lower than to the other version.
-
getMajor
public int getMajor() -
getMinor
public int getMinor() -
getRelease
public int getRelease() -
compareTo
- Specified by:
compareToin interfaceComparable<MinecraftVersion>
-
equals
-
toString
-
getCurrent()instead.