Enum Class ServerVersion
- All Implemented Interfaces:
Serializable
,Comparable<ServerVersion>
,Constable
-
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 Optional<ServerVersion>
fromProtocolVersion
(int protocolVersion) Tries to get theServerVersion
given thegetProtocolVersion()
.static Optional<ServerVersion>
fromTextVersion
(String versionText) Tries to get theServerVersion
given thegetVersionText()
.int
Gets the protocol version number.double
Returns the versionCode.Returns the versionText.Returns the versionTextSimple.boolean
isEqualsOrGreaterThan
(ServerVersion serverVersion) Checks if this version is equals or greater than the given serverVersion by parameterboolean
isEqualsOrLowerThan
(ServerVersion serverVersion) Checks if this version is equals or lower than the given serverVersion by parameterboolean
isGreaterThan
(ServerVersion serverVersion) Checks if this version is greater than the given serverVersion by parameterboolean
isLowerThan
(ServerVersion serverVersion) Checks if this version is lower than the given serverVersion by parameterstatic 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
-
MINECRAFT_1_7_2
-
MINECRAFT_1_7_5
-
MINECRAFT_1_7_9
-
MINECRAFT_1_7_10
-
MINECRAFT_1_8
-
MINECRAFT_1_8_3
-
MINECRAFT_1_8_9
-
MINECRAFT_1_9
-
MINECRAFT_1_9_1
-
MINECRAFT_1_9_2
-
MINECRAFT_1_9_4
-
MINECRAFT_1_10
-
MINECRAFT_1_11
-
MINECRAFT_1_11_1
-
MINECRAFT_1_12
-
MINECRAFT_1_12_1
-
MINECRAFT_1_12_2
-
MINECRAFT_1_13
-
MINECRAFT_1_13_1
-
MINECRAFT_1_13_2
-
MINECRAFT_1_14
-
MINECRAFT_1_14_1
-
MINECRAFT_1_14_2
-
MINECRAFT_1_14_3
-
MINECRAFT_1_14_4
-
MINECRAFT_1_15
-
MINECRAFT_1_15_1
-
MINECRAFT_1_15_2
-
MINECRAFT_1_16
-
MINECRAFT_1_16_1
-
MINECRAFT_1_16_2
-
MINECRAFT_1_16_3
-
MINECRAFT_1_16_4
-
MINECRAFT_1_17
-
MINECRAFT_1_17_1
-
MINECRAFT_1_18
-
MINECRAFT_1_18_2
-
MINECRAFT_1_19
-
MINECRAFT_1_19_1
-
-
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
-
fromTextVersion
Tries to get theServerVersion
given thegetVersionText()
.- Parameters:
versionText
- the NMS package version- Returns:
- an
Optional
containing the server version or an empty optional if the given text version is invalid
-
fromProtocolVersion
Tries to get theServerVersion
given thegetProtocolVersion()
.- Parameters:
protocolVersion
- the proxy protocol version- Returns:
- an
Optional
containing the server version or an empty optional if the given protocol version is invalid
-
getVersionText
Returns the versionText. Example: v1_12_R1- Returns:
- versionText
-
getVersionTextSimple
Returns the versionTextSimple. Example: 1.12.2- Returns:
- versionTextSimple
-
getProtocolVersion
public int getProtocolVersion()Gets the protocol version number. See ...- Returns:
- the protocol version
-
getVersionCode
public double getVersionCode()Returns the versionCode. Example: 1.12- Returns:
- versionCode
-
isEqualsOrGreaterThan
Checks if this version is equals or greater than the given serverVersion by parameter- Parameters:
serverVersion
- serverVersion- Returns:
- isSameOrGreater
-
isEqualsOrLowerThan
Checks if this version is equals or lower than the given serverVersion by parameter- Parameters:
serverVersion
- serverVersion- Returns:
- isSameOrLower
-
isGreaterThan
Checks if this version is greater than the given serverVersion by parameter- Parameters:
serverVersion
- serverVersion- Returns:
- true if it is
-
isLowerThan
Checks if this version is lower than the given serverVersion by parameter- Parameters:
serverVersion
- serverVersion- Returns:
- isLower
-