Package com.nexomc.nexo.utils
Class MinecraftVersion
-
- All Implemented Interfaces:
-
java.io.Serializable,kotlin.Comparable
public final class MinecraftVersion implements Comparable<MinecraftVersion>, Serializable
Determine the current Minecraft version.
Kristian
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classMinecraftVersion.Companion
-
Constructor Summary
Constructors Constructor Description MinecraftVersion(Server server)Determine the current Minecraft version. MinecraftVersion(String versionOnly)Construct a version format from the standard release version or the snapshot verison.
-
Method Summary
Modifier and Type Method Description final IntegergetMajor()Major version number final IntegergetMinor()Minor version number final IntegergetBuild()Build version number final StringgetDevelopmentStage()Retrieve the development stage. final StringgetVersion()Retrieve the version String (major.minor.build) only. final BooleanatOrAbove()Checks if this version is at or above the current version the server is running. IntegercompareTo(MinecraftVersion o)final BooleanisAtLeast(MinecraftVersion other)Booleanequals(Object obj)IntegerhashCode()StringtoString()-
-
Constructor Detail
-
MinecraftVersion
MinecraftVersion(Server server)
Determine the current Minecraft version.- Parameters:
server-the Bukkit server that will be used to examine the MC version.
-
MinecraftVersion
MinecraftVersion(String versionOnly)
Construct a version format from the standard release version or the snapshot verison.- Parameters:
versionOnly-the version.
-
-
Method Detail
-
getDevelopmentStage
final String getDevelopmentStage()
Retrieve the development stage.
- Returns:
Development stage, or NULL if this is a release.
-
getVersion
final String getVersion()
Retrieve the version String (major.minor.build) only.
- Returns:
A normal version string.
-
atOrAbove
final Boolean atOrAbove()
Checks if this version is at or above the current version the server is running.
- Returns:
true if this version is equal or newer than the server version, false otherwise.
-
compareTo
Integer compareTo(MinecraftVersion o)
-
isAtLeast
final Boolean isAtLeast(MinecraftVersion other)
-
-
-
-