Enum Class ClientVersion
- All Implemented Interfaces:
Serializable
,Comparable<ClientVersion>
,Constable
Client Version.
This is a nice tool for minecraft's client protocol versions.
You won't have to memorize the protocol version, just memorize the client version
as the version you see in the minecraft launcher.
Some enum constants may represent two or more versions as there have been cases where some versions have the same protocol version due to no protocol changes.
We added a comment over those enum constants so check it out.
- 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 ConstantDescriptionDeprecated.Deprecated.1.11.1 or 1.11.2 as they have the same protocol version.1.16.4 or 1.16.5 as they have the same protocol version.1.18 or 1.18.1 as they have the same protocol version.1.20 and 1.20.1 have the same protocol version.1.20.3 and 1.20.4 have the same protocol version.1.20.5 and 1.20.6 have the same protocol version.1.21 and 1.21.1 have the same protocol version.1.21.2 and 1.21.3 have the same protocol version.1.9.3 or 1.9.4 as they have the same protocol version. -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull ClientVersion
getById
(int protocolVersion) Get a ClientVersion enum by protocol version.static ClientVersion
static ClientVersion
int
Protocol version of this client version.Get the release name of this client version.boolean
is
(@NotNull VersionComparison comparison, @NotNull ClientVersion targetVersion) Is this client version newer than, older than or equal to the compared client version? This method simply checks if this client version's protocol version is greater than, less than or equal to the compared client version's protocol version.boolean
isNewerThan
(ClientVersion target) Is this client version newer than the compared client version? This method simply checks if this client version's protocol version is greater than the compared client version's protocol version.boolean
isNewerThanOrEquals
(ClientVersion target) Is this client version newer than or equal to the compared client version? This method simply checks if this client version's protocol version is newer than or equal to the compared client version's protocol version.boolean
isOlderThan
(ClientVersion target) Is this client version older than the compared client version? This method simply checks if this client version's protocol version is less than the compared client version's protocol version.boolean
isOlderThanOrEquals
(ClientVersion target) Is this client version older than or equal to the compared client version? This method simply checks if this client version's protocol version is older than or equal to the compared client version's protocol version.boolean
static boolean
isPreRelease
(int protocolVersion) boolean
static boolean
isRelease
(int protocolVersion) Deprecated.static ClientVersion
Returns the enum constant of this class with the specified name.static ClientVersion[]
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_9
-
V_1_9_1
-
V_1_9_2
-
V_1_9_3
1.9.3 or 1.9.4 as they have the same protocol version. -
V_1_10
-
V_1_11
-
V_1_11_1
1.11.1 or 1.11.2 as they have the same protocol version. -
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
1.16.4 or 1.16.5 as they have the same protocol version. -
V_1_17
-
V_1_17_1
-
V_1_18
1.18 or 1.18.1 as they have the same protocol version. -
V_1_18_2
-
V_1_19
-
V_1_19_1
-
V_1_19_3
-
V_1_19_4
-
V_1_20
1.20 and 1.20.1 have the same protocol version. -
V_1_20_2
-
V_1_20_3
1.20.3 and 1.20.4 have the same protocol version. -
V_1_20_5
1.20.5 and 1.20.6 have the same protocol version. -
V_1_21
1.21 and 1.21.1 have the same protocol version. -
V_1_21_2
1.21.2 and 1.21.3 have the same protocol version. -
V_1_21_4
-
LOWER_THAN_SUPPORTED_VERSIONS
Deprecated. -
HIGHER_THAN_SUPPORTED_VERSIONS
Deprecated. -
UNKNOWN
-
-
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
-
isPreRelease
public static boolean isPreRelease(int protocolVersion) -
isRelease
public static boolean isRelease(int protocolVersion) -
isPreRelease
public boolean isPreRelease() -
isRelease
public boolean isRelease() -
getReleaseName
Get the release name of this client version. For example, for the V_1_18 enum constant, it would return "1.18".- Returns:
- Release name
-
getById
Get a ClientVersion enum by protocol version.- Parameters:
protocolVersion
- Protocol version.- Returns:
- ClientVersion
-
getLatest
-
getOldest
-
toServerVersion
Deprecated. -
getProtocolVersion
public int getProtocolVersion()Protocol version of this client version.- Returns:
- Protocol version.
-
isNewerThan
Is this client version newer than the compared client version? This method simply checks if this client version's protocol version is greater than the compared client version's protocol version.- Parameters:
target
- Compared client version.- Returns:
- Is this client version newer than the compared client version.
-
isNewerThanOrEquals
Is this client version newer than or equal to the compared client version? This method simply checks if this client version's protocol version is newer than or equal to the compared client version's protocol version.- Parameters:
target
- Compared client version.- Returns:
- Is this client version newer than or equal to the compared client version.
-
isOlderThan
Is this client version older than the compared client version? This method simply checks if this client version's protocol version is less than the compared client version's protocol version.- Parameters:
target
- Compared client version.- Returns:
- Is this client version older than the compared client version.
-
isOlderThanOrEquals
Is this client version older than or equal to the compared client version? This method simply checks if this client version's protocol version is older than or equal to the compared client version's protocol version.- Parameters:
target
- Compared client version.- Returns:
- Is this client version older than or equal to the compared client version.
-
is
public boolean is(@NotNull @NotNull VersionComparison comparison, @NotNull @NotNull ClientVersion targetVersion) Is this client version newer than, older than or equal to the compared client version? This method simply checks if this client version's protocol version is greater than, less than or equal to the compared client version's protocol version.- Parameters:
comparison
- Comparison type.targetVersion
- Compared client version.- Returns:
- true or false, based on the comparison type.
- See Also:
-