public class MinecraftVersion extends java.lang.Object implements java.lang.Comparable<MinecraftVersion>
Constructor and Description |
---|
MinecraftVersion(int major,
int minor,
int build)
Construct a version object directly.
|
MinecraftVersion(int major,
int minor,
int build,
java.lang.String development)
Construct a version object directly.
|
MinecraftVersion(org.bukkit.Server server)
Determine the current Minecraft version.
|
MinecraftVersion(java.lang.String versionOnly)
Construct a version object from the format major.minor.build.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(MinecraftVersion o) |
boolean |
equals(java.lang.Object obj) |
static java.lang.String |
extractVersion(java.lang.String text)
Extract the Minecraft version from CraftBukkit itself.
|
int |
getBuild()
Build version number
|
java.lang.String |
getDevelopmentStage()
Retrieve the development stage.
|
int |
getMajor()
Major version number
|
int |
getMinor()
Minor version number
|
java.lang.String |
getVersion()
Retrieve the version String (major.minor.build) only.
|
int |
hashCode() |
java.lang.String |
toString() |
public MinecraftVersion(org.bukkit.Server server)
server
- - the Bukkit server that will be used to examine the MC version.public MinecraftVersion(java.lang.String versionOnly)
versionOnly
- - the version in text form.public MinecraftVersion(int major, int minor, int build)
major
- - major version number.minor
- - minor version number.build
- - build version number.public MinecraftVersion(int major, int minor, int build, java.lang.String development)
major
- - major version number.minor
- - minor version number.build
- - build version number.development
- - development stage.public int getMajor()
public int getMinor()
public int getBuild()
public java.lang.String getDevelopmentStage()
public java.lang.String getVersion()
public int compareTo(MinecraftVersion o)
compareTo
in interface java.lang.Comparable<MinecraftVersion>
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String extractVersion(java.lang.String text)
server
- - the server object representing CraftBukkit.java.lang.IllegalStateException
- If we could not parse the version string.