Package com.comphenix.protocol.utility
Class MinecraftVersion
java.lang.Object
com.comphenix.protocol.utility.MinecraftVersion
- All Implemented Interfaces:
Serializable,Comparable<MinecraftVersion>
Determine the current Minecraft version.
- Author:
- Kristian
- See Also:
- Serialized Form
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic MinecraftVersionVersion 1.13 - update aquatic.static MinecraftVersionVersion 1.15 - the bee updatestatic MinecraftVersionVersion 1.8 - the "bountiful" update.static MinecraftVersionVersion 1.17 - caves and cliffs part 1static MinecraftVersionVersion 1.12 - the world of color update.static MinecraftVersionVersion 1.9 - the combat update.static MinecraftVersionVersion 1.11 - the exploration update.static MinecraftVersionVersion 1.10 - the frostburn update.static MinecraftVersionVersion 1.6.1 - the horse update.static MinecraftVersionVersion 1.16.0 - the nether updatestatic MinecraftVersionVersion 1.16.2 - breaking change to the nether updatestatic MinecraftVersionVersion 1.5.0 - the redstone update.static MinecraftVersionVersion 1.4.2 - the scary update (Wither Boss).static MinecraftVersionVersion 1.7.8 - the update that changed the skin format (and distribution - R.I.P.static MinecraftVersionVersion 1.14 - village and pillage update.static MinecraftVersionVersion 1.7.2 - the update that changed the world. -
Constructor Summary
ConstructorsConstructorDescriptionMinecraftVersion(int major, int minor, int build)Construct a version object directly.MinecraftVersion(int major, int minor, int build, String development)Construct a version object directly.MinecraftVersion(String versionOnly)Construct a version object from the format major.minor.build, or the snapshot format.MinecraftVersion(org.bukkit.Server server)Determine the current Minecraft version. -
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic booleanatOrAbove(MinecraftVersion version)intbooleanstatic StringextractVersion(String text)Extract the Minecraft version from CraftBukkit itself.static MinecraftVersionfromServerVersion(String serverVersion)Parse the given server version into a Minecraft version.intgetBuild()Build version numberstatic MinecraftVersionRetrieve the development stage.intgetMajor()Major version numberintgetMinor()Minor version numberRetrieve the snapshot version, or NULL if this is a release.Retrieve the version String (major.minor.build) only.inthashCode()booleanisAtLeast(MinecraftVersion other)booleanDetermine if this version is a snapshot.static voidsetCurrentVersion(MinecraftVersion version)toString()
-
Field Details
-
CAVES_CLIFFS_1
Version 1.17 - caves and cliffs part 1 -
NETHER_UPDATE_2
Version 1.16.2 - breaking change to the nether update -
NETHER_UPDATE
Version 1.16.0 - the nether update -
BEE_UPDATE
Version 1.15 - the bee update -
VILLAGE_UPDATE
Version 1.14 - village and pillage update. -
AQUATIC_UPDATE
Version 1.13 - update aquatic. -
COLOR_UPDATE
Version 1.12 - the world of color update. -
EXPLORATION_UPDATE
Version 1.11 - the exploration update. -
FROSTBURN_UPDATE
Version 1.10 - the frostburn update. -
COMBAT_UPDATE
Version 1.9 - the combat update. -
BOUNTIFUL_UPDATE
Version 1.8 - the "bountiful" update. -
SKIN_UPDATE
Version 1.7.8 - the update that changed the skin format (and distribution - R.I.P. player disguise) -
WORLD_UPDATE
Version 1.7.2 - the update that changed the world. -
HORSE_UPDATE
Version 1.6.1 - the horse update. -
REDSTONE_UPDATE
Version 1.5.0 - the redstone update. -
SCARY_UPDATE
Version 1.4.2 - the scary update (Wither Boss).
-
-
Constructor Details
-
MinecraftVersion
public MinecraftVersion(org.bukkit.Server server)Determine the current Minecraft version.- Parameters:
server- - the Bukkit server that will be used to examine the MC version.
-
MinecraftVersion
Construct a version object from the format major.minor.build, or the snapshot format.- Parameters:
versionOnly- - the version in text form.
-
MinecraftVersion
public MinecraftVersion(int major, int minor, int build)Construct a version object directly.- Parameters:
major- - major version number.minor- - minor version number.build- - build version number.
-
MinecraftVersion
Construct a version object directly.- Parameters:
major- - major version number.minor- - minor version number.build- - build version number.development- - development stage.
-
-
Method Details
-
getMajor
public int getMajor()Major version number- Returns:
- Current major version number.
-
getMinor
public int getMinor()Minor version number- Returns:
- Current minor version number.
-
getBuild
public int getBuild()Build version number- Returns:
- Current build version number.
-
getDevelopmentStage
Retrieve the development stage.- Returns:
- Development stage, or NULL if this is a release.
-
getSnapshot
Retrieve the snapshot version, or NULL if this is a release.- Returns:
- The snapshot version.
-
isSnapshot
public boolean isSnapshot()Determine if this version is a snapshot.- Returns:
- The snapshot version.
-
atOrAbove
public boolean atOrAbove() -
getVersion
Retrieve the version String (major.minor.build) only.- Returns:
- A normal version string.
-
compareTo
- Specified by:
compareToin interfaceComparable<MinecraftVersion>
-
isAtLeast
-
equals
-
hashCode
public int hashCode() -
toString
-
extractVersion
Extract the Minecraft version from CraftBukkit itself.- Parameters:
text- - the server version in text form.- Returns:
- The underlying MC version.
- Throws:
IllegalStateException- If we could not parse the version string.
-
fromServerVersion
Parse the given server version into a Minecraft version.- Parameters:
serverVersion- - the server version.- Returns:
- The resulting Minecraft version.
-
setCurrentVersion
-
getCurrentVersion
-
atOrAbove
-