public class MinecraftVersion extends java.lang.Object implements java.lang.Comparable<MinecraftVersion>, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static MinecraftVersion |
HORSE_UPDATE
Version 1.6.1 - the horse update.
|
static MinecraftVersion |
REDSTONE_UPDATE
Version 1.5.0 - the redstone update.
|
static MinecraftVersion |
SCARY_UPDATE
Version 1.4.2 - the scary update (Wither Boss).
|
static MinecraftVersion |
SKIN_UPDATE
Version 1.7.8 - the update that changed the skin format (and distribution - R.I.P.
|
static MinecraftVersion |
WORLD_UPDATE
Version 1.7.2 - the update that changed the world.
|
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, or the snapshot format.
|
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.
|
static MinecraftVersion |
fromServerVersion(java.lang.String serverVersion)
Parse the given server version into a Minecraft version.
|
int |
getBuild()
Build version number
|
java.lang.String |
getDevelopmentStage()
Retrieve the development stage.
|
int |
getMajor()
Major version number
|
int |
getMinor()
Minor version number
|
SnapshotVersion |
getSnapshot()
Retrieve the snapshot version, or NULL if this is a release.
|
java.lang.String |
getVersion()
Retrieve the version String (major.minor.build) only.
|
int |
hashCode() |
boolean |
isSnapshot()
Determine if this version is a snapshot.
|
java.lang.String |
toString() |
public static final MinecraftVersion SKIN_UPDATE
public static final MinecraftVersion WORLD_UPDATE
public static final MinecraftVersion HORSE_UPDATE
public static final MinecraftVersion REDSTONE_UPDATE
public static final MinecraftVersion SCARY_UPDATE
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 SnapshotVersion getSnapshot()
public boolean isSnapshot()
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)
text
- - the server version in text form.java.lang.IllegalStateException
- If we could not parse the version string.public static MinecraftVersion fromServerVersion(java.lang.String serverVersion)
serverVersion
- - the server version.