Package net.minecraft.network
Enum Class ConnectionProtocol
- All Implemented Interfaces:
Serializable
,Comparable<ConnectionProtocol>
,Constable
Describes the set of packets a connection understands at a given point.
A connection always starts out in state
. The server then either accepts the connection and switches to the desired protocol or it disconnects the client (for example in case of an outdated client).
Each protocol has a
HANDSHAKING
. In this state the client sends its desired protocol using
invalid reference
ClientIntentionPacket
PacketListener
implementation tied to it for server and client respectively.
Every packet must correspond to exactly one protocol.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe handshake protocol.The login protocol.The play protocol.The status protocol. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionid()
boolean
boolean
isPlay()
static ConnectionProtocol
Returns the enum constant of this class with the specified name.static ConnectionProtocol[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
HANDSHAKING
The handshake protocol. This is the initial protocol, in which the client tells the server its intention (i.e. which protocol it wants to use). -
PLAY
The play protocol. This is the main protocol that is used while "in game" and most normal packets reside in here. -
STATUS
The status protocol. This protocol is used when a client pings a server while on the multiplayer screen. -
LOGIN
The login protocol. This is the first protocol the client switches to to join a server. It handles authentication with the mojang servers. After it is complete, the connection is switched to the PLAY protocol. -
CONFIGURATION
-
-
Field Details
-
id
-
-
Constructor Details
-
ConnectionProtocol
-
-
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
-
id
-
isPlay
public boolean isPlay() -
isConfiguration
public boolean isConfiguration()
-