Enum Class ServerVersion
- All Implemented Interfaces:
Serializable
,Comparable<ServerVersion>
,Constable
Server Version.
This is a nice wrapper over minecraft's protocol versions.
You won't have to memorize the protocol version, just memorize the server version you see in the launcher.
- Since:
- 1.6.9
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescription -
Method Summary
Modifier and TypeMethodDescriptionstatic ServerVersion
getById
(int protocolVersion) Deprecated.static ServerVersion
static ServerVersion
int
Get this server version's protocol version.Get the release name of this server version.boolean
is
(@NotNull VersionComparison comparison, @NotNull ServerVersion targetVersion) Is this server version newer than, older than or equal to the compared server version? This method simply checks if this server version's protocol version is greater than, less than or equal to the compared server version's protocol version.boolean
isNewerThan
(ServerVersion target) Is this server version newer than the compared server version? This method simply checks if this server version's protocol version is greater than the compared server version's protocol version.boolean
isNewerThanOrEquals
(ServerVersion target) Is this server version newer than or equal to the compared server version? This method simply checks if this server version's protocol version is greater than or equal to the compared server version's protocol version.boolean
isOlderThan
(ServerVersion target) Is this server version older than the compared server version? This method simply checks if this server version's protocol version is less than the compared server version's protocol version.boolean
isOlderThanOrEquals
(ServerVersion target) Is this server version older than or equal to the compared server version? This method simply checks if this server version's protocol version is older than or equal to the compared server version's protocol version.static ServerVersion[]
static ServerVersion
Returns the enum constant of this class with the specified name.static ServerVersion[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
V_1_7_10
-
V_1_8
-
V_1_8_3
-
V_1_8_8
-
V_1_9
-
V_1_9_1
-
V_1_9_2
-
V_1_9_4
-
V_1_10
-
V_1_10_1
-
V_1_10_2
-
V_1_11
-
V_1_11_2
-
V_1_12
-
V_1_12_1
-
V_1_12_2
-
V_1_13
-
V_1_13_1
-
V_1_13_2
-
V_1_14
-
V_1_14_1
-
V_1_14_2
-
V_1_14_3
-
V_1_14_4
-
V_1_15
-
V_1_15_1
-
V_1_15_2
-
V_1_16
-
V_1_16_1
-
V_1_16_2
-
V_1_16_3
-
V_1_16_4
-
V_1_16_5
-
V_1_17
-
V_1_17_1
-
V_1_18
-
V_1_18_1
-
V_1_18_2
-
V_1_19
-
V_1_19_1
-
V_1_19_2
-
V_1_19_3
-
V_1_19_4
-
V_1_20
-
V_1_20_1
-
V_1_20_2
-
V_1_20_3
-
V_1_20_4
-
V_1_20_5
-
V_1_20_6
-
V_1_21
-
V_1_21_1
-
V_1_21_2
-
V_1_21_3
-
V_1_21_4
-
ERROR
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
reversedValues
-
getLatest
-
getOldest
-
getById
Deprecated. -
toClientVersion
-
getReleaseName
Get the release name of this server version. For example, for the V_1_18 enum constant, it would return "1.18".- Returns:
- Release name
-
getProtocolVersion
public int getProtocolVersion()Get this server version's protocol version.- Returns:
- Protocol version.
-
isNewerThan
Is this server version newer than the compared server version? This method simply checks if this server version's protocol version is greater than the compared server version's protocol version.- Parameters:
target
- Compared server version.- Returns:
- Is this server version newer than the compared server version.
-
isOlderThan
Is this server version older than the compared server version? This method simply checks if this server version's protocol version is less than the compared server version's protocol version.- Parameters:
target
- Compared server version.- Returns:
- Is this server version older than the compared server version.
-
isNewerThanOrEquals
Is this server version newer than or equal to the compared server version? This method simply checks if this server version's protocol version is greater than or equal to the compared server version's protocol version.- Parameters:
target
- Compared server version.- Returns:
- Is this server version newer than or equal to the compared server version.
-
isOlderThanOrEquals
Is this server version older than or equal to the compared server version? This method simply checks if this server version's protocol version is older than or equal to the compared server version's protocol version.- Parameters:
target
- Compared server version.- Returns:
- Is this server version older than or equal to the compared server version.
-
is
public boolean is(@NotNull @NotNull VersionComparison comparison, @NotNull @NotNull ServerVersion targetVersion) Is this server version newer than, older than or equal to the compared server version? This method simply checks if this server version's protocol version is greater than, less than or equal to the compared server version's protocol version.- Parameters:
comparison
- Comparison type.targetVersion
- Compared server version.- Returns:
- true or false, based on the comparison type.
- See Also:
-