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 ConstantsEnum ConstantDescriptionRepresents legacy protocol versions before 1.7.Minecraft 1.10 to 1.10.2.Minecraft 1.11.Minecraft 1.11.1 to 1.11.2.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 to 1.16.5.Minecraft 1.17.Minecraft 1.17.1.Minecraft 1.18 to 1.18.1.Minecraft 1.18.2.Minecraft 1.19.Minecraft 1.19.1 to 1.19.2.Minecraft 1.19.3.Minecraft 1.19.4.Minecraft 1.20 to 1.20.1.Minecraft 1.20.2.Minecraft 1.20.3 to 1.20.4.Minecraft 1.20.5 to 1.20.6.Minecraft 1.21 to 1.21.1.Minecraft 1.21.11.Minecraft 1.21.2 to 1.21.3.Minecraft 1.21.4.Minecraft 1.21.5.Minecraft 1.21.6.Minecraft 1.21.7 to 1.21.8.Minecraft 1.21.9 to 1.21.10.Minecraft 1.7.2 to 1.7.5.Minecraft 1.7.6 to 1.7.10.Minecraft 1.8 to 1.8.9.Minecraft 1.9.Minecraft 1.9.1.Minecraft 1.9.2.Minecraft 1.9.3 to 1.9.4.Represents an unknown protocol version. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ImmutableMap<Integer, ProtocolVersion> A map linking the protocol version number to itsProtocolVersionrepresentation.static final ProtocolVersionRepresents the highest supported version.static final ProtocolVersionRepresents the lowest supported version.static final StringThe 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.intReturns the protocol as an int.static ProtocolVersiongetProtocolVersion(int protocol) Gets theProtocolVersionfor the given protocol.Returns the user-friendly name of the version this protocol was introduced in.Returns all versions this protocol is valid for.booleanisLegacy()Returns whether thisProtocolVersionis a legacy protocol.booleanReturns whether thisProtocolVersionis supported.static booleanisSupported(int protocol) Returns whether the protocol is supported.static booleanisSupported(ProtocolVersion version) Returns whether theProtocolVersionis supported.booleanReturns whether thisProtocolVersionis unknown to the proxy.toString()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.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOfMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.velocitypowered.api.util.Ordered
greaterThan, lessThan, noGreaterOrLessThan, noGreaterThan, noLessThan
-
Enum Constant Details
-
UNKNOWN
Represents an unknown protocol version. -
LEGACY
Represents legacy protocol versions before 1.7. -
MINECRAFT_1_7_2
Minecraft 1.7.2 to 1.7.5. -
MINECRAFT_1_7_6
Minecraft 1.7.6 to 1.7.10. -
MINECRAFT_1_8
Minecraft 1.8 to 1.8.9. -
MINECRAFT_1_9
Minecraft 1.9. -
MINECRAFT_1_9_1
Minecraft 1.9.1. -
MINECRAFT_1_9_2
Minecraft 1.9.2. -
MINECRAFT_1_9_4
Minecraft 1.9.3 to 1.9.4. -
MINECRAFT_1_10
Minecraft 1.10 to 1.10.2. -
MINECRAFT_1_11
Minecraft 1.11. -
MINECRAFT_1_11_1
Minecraft 1.11.1 to 1.11.2. -
MINECRAFT_1_12
Minecraft 1.12. -
MINECRAFT_1_12_1
Minecraft 1.12.1. -
MINECRAFT_1_12_2
Minecraft 1.12.2. -
MINECRAFT_1_13
Minecraft 1.13. -
MINECRAFT_1_13_1
Minecraft 1.13.1. -
MINECRAFT_1_13_2
Minecraft 1.13.2. -
MINECRAFT_1_14
Minecraft 1.14. -
MINECRAFT_1_14_1
Minecraft 1.14.1. -
MINECRAFT_1_14_2
Minecraft 1.14.2. -
MINECRAFT_1_14_3
Minecraft 1.14.3. -
MINECRAFT_1_14_4
Minecraft 1.14.4. -
MINECRAFT_1_15
Minecraft 1.15. -
MINECRAFT_1_15_1
Minecraft 1.15.1. -
MINECRAFT_1_15_2
Minecraft 1.15.2. -
MINECRAFT_1_16
Minecraft 1.16. -
MINECRAFT_1_16_1
Minecraft 1.16.1. -
MINECRAFT_1_16_2
Minecraft 1.16.2. -
MINECRAFT_1_16_3
Minecraft 1.16.3. -
MINECRAFT_1_16_4
Minecraft 1.16.4 to 1.16.5. -
MINECRAFT_1_17
Minecraft 1.17. -
MINECRAFT_1_17_1
Minecraft 1.17.1. -
MINECRAFT_1_18
Minecraft 1.18 to 1.18.1. -
MINECRAFT_1_18_2
Minecraft 1.18.2. -
MINECRAFT_1_19
Minecraft 1.19. -
MINECRAFT_1_19_1
Minecraft 1.19.1 to 1.19.2. -
MINECRAFT_1_19_3
Minecraft 1.19.3. -
MINECRAFT_1_19_4
Minecraft 1.19.4. -
MINECRAFT_1_20
Minecraft 1.20 to 1.20.1. -
MINECRAFT_1_20_2
Minecraft 1.20.2. -
MINECRAFT_1_20_3
Minecraft 1.20.3 to 1.20.4. -
MINECRAFT_1_20_5
Minecraft 1.20.5 to 1.20.6. -
MINECRAFT_1_21
Minecraft 1.21 to 1.21.1. -
MINECRAFT_1_21_2
Minecraft 1.21.2 to 1.21.3. -
MINECRAFT_1_21_4
Minecraft 1.21.4. -
MINECRAFT_1_21_5
Minecraft 1.21.5. -
MINECRAFT_1_21_6
Minecraft 1.21.6. -
MINECRAFT_1_21_7
Minecraft 1.21.7 to 1.21.8. -
MINECRAFT_1_21_9
Minecraft 1.21.9 to 1.21.10. -
MINECRAFT_1_21_11
Minecraft 1.21.11.
-
-
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 itsProtocolVersionrepresentation. -
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 thisProtocolVersionis 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 theProtocolVersionis supported.- Parameters:
version- the protocol version- Returns:
- if the protocol supported
-
getProtocolVersion
Gets theProtocolVersionfor the given protocol.- Parameters:
protocol- the protocol as an int- Returns:
- the protocol version
-
isUnknown
public boolean isUnknown()Returns whether thisProtocolVersionis unknown to the proxy.- Returns:
- if the protocol is unknown
-
isLegacy
public boolean isLegacy()Returns whether thisProtocolVersionis a legacy protocol.- Returns:
- if the protocol is legacy
-
toString
- Overrides:
toStringin classEnum<ProtocolVersion>
-