Package me.neznamy.tab.api
Enum Class ProtocolVersion
- All Implemented Interfaces:
Serializable,Comparable<ProtocolVersion>,Constable
Enum class representing all possibly used protocol versions
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ProtocolVersion[]Value array to iterate over to avoid array creations on each call -
Method Summary
Modifier and TypeMethodDescriptionstatic ProtocolVersionfromFriendlyName(String friendlyName) Returns enum constant of entered version or UNKNOWN_SERVER_VERSION if unknown versionstatic ProtocolVersionfromNetworkId(int networkId) Returns version from given network idReturns user-friendly name of the version (such as 1.16.2 instead of V1_16_2)intReturns minor version of this release, such as 8 for 1.8.x or 13 for 1.13.xintReturns the version's network idvoidsetMinorVersion(int minorVersion) Overrides minor version of the version instance.static ProtocolVersionReturns the enum constant of this class with the specified name.static ProtocolVersion[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
UNKNOWN_SERVER_VERSION
-
UNKNOWN_CLIENT_VERSION
-
PROXY
-
V1_18_2
-
V1_18_1
-
V1_18
-
V1_17_1
-
V1_17
-
V1_16_5
-
V1_16_4
-
V1_16_3
-
V1_16_2
-
V1_16_1
-
V1_16
-
V1_15_2
-
V1_15_1
-
V1_15
-
V1_14_4
-
V1_14_3
-
V1_14_2
-
V1_14_1
-
V1_14
-
V1_13_2
-
V1_13_1
-
V1_13
-
V1_12_2
-
V1_12_1
-
V1_12
-
V1_11_2
-
V1_11_1
-
V1_11
-
V1_10_2
-
V1_10_1
-
V1_10
-
V1_9_4
-
V1_9_3
-
V1_9_2
-
V1_9_1
-
V1_9
-
V1_8
-
V1_7_10
-
V1_7_9
-
V1_7_8
-
V1_7_7
-
V1_7_6
-
V1_7_5
-
V1_7_4
-
V1_7_2
-
V1_6_4
-
V1_6_2
-
V1_6_1
-
V1_5_2
-
V1_5_1
-
V1_5
-
V1_4_7
-
V1_4_6
-
-
Field Details
-
VALUES
Value array to iterate over to avoid array creations on each call
-
-
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
-
getNetworkId
public int getNetworkId()Returns the version's network id- Returns:
- version's network id
-
getFriendlyName
Returns user-friendly name of the version (such as 1.16.2 instead of V1_16_2)- Returns:
- user-friendly name of the version
-
getMinorVersion
public int getMinorVersion()Returns minor version of this release, such as 8 for 1.8.x or 13 for 1.13.x- Returns:
- version's minor version
-
setMinorVersion
public void setMinorVersion(int minorVersion) Overrides minor version of the version instance. This is used internally to set minor version of UNKNOWN_SERVER_VERSION value to value from package to fix compatibility with server forks that set bukkit version field value to "Unknown".- Parameters:
minorVersion- minor version to change value to
-
fromFriendlyName
Returns enum constant of entered version or UNKNOWN_SERVER_VERSION if unknown version- Parameters:
friendlyName- friendly name of the version- Returns:
- version or UNKNOWN_SERVER_VERSION if version is unknown
-
fromNetworkId
Returns version from given network id- Parameters:
networkId- network id of protocol version- Returns:
- version from given network id
-