public enum ProtocolVersion extends Enum<ProtocolVersion>
Modifier and Type | Field and Description |
---|---|
static ImmutableMap<Integer,ProtocolVersion> |
ID_TO_PROTOCOL_CONSTANT
A map linking the protocol version number to its
ProtocolVersion representation. |
static ProtocolVersion |
MAXIMUM_VERSION
Represents the highest supported version.
|
static ProtocolVersion |
MINIMUM_VERSION
Represents the lowest supported version.
|
static String |
SUPPORTED_VERSION_STRING
The user-friendly representation of the lowest and highest supported versions.
|
static Set<ProtocolVersion> |
SUPPORTED_VERSIONS
|
Modifier and Type | Method and Description |
---|---|
String |
getName()
Returns the user-friendly name for this protocol.
|
int |
getProtocol()
Returns the protocol as an int.
|
static ProtocolVersion |
getProtocolVersion(int protocol)
Gets the
ProtocolVersion for the given protocol. |
boolean |
isLegacy()
Returns whether this
ProtocolVersion is a legacy protocol. |
static boolean |
isSupported(int protocol)
Returns whether the protocol is supported.
|
static boolean |
isSupported(ProtocolVersion version)
Returns whether the
ProtocolVersion is supported. |
boolean |
isUnknown()
Returns whether this
ProtocolVersion is unknown to the proxy. |
String |
toString() |
static ProtocolVersion |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ProtocolVersion[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ProtocolVersion UNKNOWN
public static final ProtocolVersion LEGACY
public static final ProtocolVersion MINECRAFT_1_8
public static final ProtocolVersion MINECRAFT_1_9
public static final ProtocolVersion MINECRAFT_1_9_1
public static final ProtocolVersion MINECRAFT_1_9_2
public static final ProtocolVersion MINECRAFT_1_9_4
public static final ProtocolVersion MINECRAFT_1_10
public static final ProtocolVersion MINECRAFT_1_11
public static final ProtocolVersion MINECRAFT_1_11_1
public static final ProtocolVersion MINECRAFT_1_12
public static final ProtocolVersion MINECRAFT_1_12_1
public static final ProtocolVersion MINECRAFT_1_12_2
public static final ProtocolVersion MINECRAFT_1_13
public static final ProtocolVersion MINECRAFT_1_13_1
public static final ProtocolVersion MINECRAFT_1_13_2
public static final ProtocolVersion MINECRAFT_1_14
public static final ProtocolVersion MINECRAFT_1_14_1
public static final ProtocolVersion MINECRAFT_1_14_2
public static final ProtocolVersion MINIMUM_VERSION
public static final ProtocolVersion MAXIMUM_VERSION
public static final String SUPPORTED_VERSION_STRING
public static final ImmutableMap<Integer,ProtocolVersion> ID_TO_PROTOCOL_CONSTANT
ProtocolVersion
representation.public static final Set<ProtocolVersion> SUPPORTED_VERSIONS
public static ProtocolVersion[] values()
for (ProtocolVersion c : ProtocolVersion.values()) System.out.println(c);
public static ProtocolVersion valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic int getProtocol()
public String getName()
public static ProtocolVersion getProtocolVersion(int protocol)
ProtocolVersion
for the given protocol.protocol
- the protocol as an intpublic static boolean isSupported(int protocol)
protocol
- the protocol as an intpublic static boolean isSupported(ProtocolVersion version)
ProtocolVersion
is supported.version
- the protocol versionpublic boolean isUnknown()
ProtocolVersion
is unknown to the proxy.public boolean isLegacy()
ProtocolVersion
is a legacy protocol.public String toString()
toString
in class Enum<ProtocolVersion>