Package com.velocitypowered.api.network
Enum Class ProtocolVersion
- All Implemented Interfaces:
Ordered<ProtocolVersion>
,Serializable
,Comparable<ProtocolVersion>
,Constable
Represents each Minecraft protocol version.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescription -
Field Summary
Modifier and TypeFieldDescriptionstatic final ImmutableMap<Integer,
ProtocolVersion> A map linking the protocol version number to itsProtocolVersion
representation.static final ProtocolVersion
Represents the highest supported version.static final ProtocolVersion
Represents the lowest supported version.static final String
The user-friendly representation of the lowest and highest supported versions.static final Set<ProtocolVersion>
-
Method Summary
Modifier and TypeMethodDescriptionReturns the user-friendly name of the last version this protocol is valid for.getName()
Deprecated.A protocol may be shared by multiple versions.int
Returns the protocol as an int.static ProtocolVersion
getProtocolVersion
(int protocol) Gets theProtocolVersion
for the given protocol.Returns the user-friendly name of the version this protocol was introduced in.Returns all versions this protocol is valid for.boolean
isLegacy()
Returns whether thisProtocolVersion
is a legacy protocol.boolean
Returns whether thisProtocolVersion
is supported.static boolean
isSupported
(int protocol) Returns whether the protocol is supported.static boolean
isSupported
(ProtocolVersion version) Returns whether theProtocolVersion
is supported.boolean
Returns whether thisProtocolVersion
is unknown to the proxy.toString()
static ProtocolVersion
Returns 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.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.velocitypowered.api.util.Ordered
greaterThan, lessThan, noGreaterOrLessThan, noGreaterThan, noLessThan
-
Enum Constant Details
-
UNKNOWN
-
LEGACY
-
MINECRAFT_1_7_2
-
MINECRAFT_1_7_6
-
MINECRAFT_1_8
-
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
-
MINECRAFT_1_19_3
-
MINECRAFT_1_19_4
-
MINECRAFT_1_20
-
MINECRAFT_1_20_2
-
MINECRAFT_1_20_3
-
MINECRAFT_1_20_5
-
MINECRAFT_1_21
-
-
Field Details
-
MINIMUM_VERSION
Represents the lowest supported version. -
MAXIMUM_VERSION
Represents the highest supported version. -
SUPPORTED_VERSION_STRING
The user-friendly representation of the lowest and highest supported versions. -
ID_TO_PROTOCOL_CONSTANT
A map linking the protocol version number to itsProtocolVersion
representation. -
SUPPORTED_VERSIONS
-
-
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
-
getProtocol
public int getProtocol()Returns the protocol as an int.- Returns:
- the protocol version
-
getName
Deprecated.A protocol may be shared by multiple versions. Use @link{#getVersionIntroducedIn()} or @link{#getVersionsSupportedBy()} to get more accurate version names.Returns the user-friendly name for this protocol.- Returns:
- the protocol name
-
getVersionIntroducedIn
Returns the user-friendly name of the version this protocol was introduced in.- Returns:
- the version name
-
getMostRecentSupportedVersion
Returns the user-friendly name of the last version this protocol is valid for.- Returns:
- the version name
-
getVersionsSupportedBy
Returns all versions this protocol is valid for.- Returns:
- the version names
-
isSupported
public boolean isSupported()Returns whether thisProtocolVersion
is supported.- Returns:
- if the protocol supported
-
isSupported
public static boolean isSupported(int protocol) Returns whether the protocol is supported.- Parameters:
protocol
- the protocol as an int- Returns:
- if the protocol supported
-
isSupported
Returns whether theProtocolVersion
is supported.- Parameters:
version
- the protocol version- Returns:
- if the protocol supported
-
getProtocolVersion
Gets theProtocolVersion
for the given protocol.- Parameters:
protocol
- the protocol as an int- Returns:
- the protocol version
-
isUnknown
public boolean isUnknown()Returns whether thisProtocolVersion
is unknown to the proxy.- Returns:
- if the protocol is unknown
-
isLegacy
public boolean isLegacy()Returns whether thisProtocolVersion
is a legacy protocol.- Returns:
- if the protocol is legacy
-
toString
- Overrides:
toString
in classEnum<ProtocolVersion>
-