Interface ProtocolInfo
public interface ProtocolInfo
-
Method Summary
Modifier and TypeMethodDescriptionReturns the protocol state the client is currently in.Returns the user's pipeline.default int
Deprecated.default int
Deprecated.Returns the protocol state the server is currently in.default State
Returns the protocol state for the given direction.@Nullable String
Returns the username associated with this connection.@Nullable UUID
getUuid()
Returns the uuid associated with this connection.Returns the user's protocol version, or null if not set.Returns the server protocol version the user is connected to.void
setClientState
(State clientState) Sets the client protocol state.void
setPipeline
(ProtocolPipeline pipeline) void
setProtocolVersion
(ProtocolVersion protocolVersion) void
setServerProtocolVersion
(ProtocolVersion protocolVersion) void
setServerState
(State serverState) Sets the server protocol state.default void
Sets both client and server state.void
setUsername
(String username) void
-
Method Details
-
getClientState
State getClientState()Returns the protocol state the client is currently in.- Returns:
- the client protocol state
-
getServerState
State getServerState()Returns the protocol state the server is currently in.- Returns:
- the server protocol state
-
getState
Returns the protocol state for the given direction.- Parameters:
direction
- protocol direction- Returns:
- state for the given direction
-
setState
Sets both client and server state.- Parameters:
state
- the new protocol state- See Also:
-
setClientState
Sets the client protocol state.- Parameters:
clientState
- the new client protocol state
-
setServerState
Sets the server protocol state.- Parameters:
serverState
- the new server protocol state
-
protocolVersion
ProtocolVersion protocolVersion()Returns the user's protocol version, or null if not set. This is set during theState.HANDSHAKE
state.- Returns:
- protocol version, may be unknown
- See Also:
-
setProtocolVersion
-
serverProtocolVersion
ProtocolVersion serverProtocolVersion()Returns the server protocol version the user is connected to. This is set during theState.HANDSHAKE
state.- Returns:
- the server protocol version the user is connected to, may be unknown
- See Also:
-
setServerProtocolVersion
-
getProtocolVersion
Deprecated. -
getServerProtocolVersion
Deprecated. -
getUsername
@Nullable String getUsername()Returns the username associated with this connection. This is set once the connection enters theState.PLAY
state.- Returns:
- username, set when entering the
State.PLAY
state
-
setUsername
-
getUuid
@Nullable UUID getUuid()Returns the uuid associated with this connection. This is set once the connection enters theState.PLAY
state.- Returns:
- uuid, set when entering the
State.PLAY
state
-
setUuid
-
getPipeline
ProtocolPipeline getPipeline()Returns the user's pipeline.- Returns:
- protocol pipeline
-
setPipeline
-