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 class
MinecraftVersion.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 Integer
getMajor()
Major version number final Integer
getMinor()
Minor version number final Integer
getBuild()
Build version number final String
getDevelopmentStage()
Retrieve the development stage. final String
getVersion()
Retrieve the version String (major.minor.build) only. final Boolean
atOrAbove()
Checks if this version is at or above the current version the server is running. Integer
compareTo(MinecraftVersion o)
final Boolean
isAtLeast(MinecraftVersion other)
Boolean
equals(Object obj)
Integer
hashCode()
String
toString()
-
-
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)
-
-
-
-