Interface ProtocolInfo


public interface ProtocolInfo
  • 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

      default State getState(Direction direction)
      Returns the protocol state for the given direction.
      Parameters:
      direction - protocol direction
      Returns:
      state for the given direction
    • setState

      default void setState(State state)
      Sets both client and server state.
      Parameters:
      state - the new protocol state
      See Also:
    • setClientState

      void setClientState(State clientState)
      Sets the client protocol state.
      Parameters:
      clientState - the new client protocol state
    • setServerState

      void setServerState(State serverState)
      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 the State.HANDSHAKE state.
      Returns:
      protocol version, may be unknown
      See Also:
    • setProtocolVersion

      void setProtocolVersion(ProtocolVersion protocolVersion)
    • serverProtocolVersion

      ProtocolVersion serverProtocolVersion()
      Returns the server protocol version the user is connected to. This is set during the State.HANDSHAKE state.
      Returns:
      the server protocol version the user is connected to, may be unknown
      See Also:
    • setServerProtocolVersion

      void setServerProtocolVersion(ProtocolVersion protocolVersion)
    • getProtocolVersion

      @Deprecated default int getProtocolVersion()
      Deprecated.
    • getServerProtocolVersion

      @Deprecated default int getServerProtocolVersion()
      Deprecated.
    • getUsername

      @Nullable String getUsername()
      Returns the username associated with this connection. This is set once the connection enters the State.PLAY state.
      Returns:
      username, set when entering the State.PLAY state
    • setUsername

      void setUsername(String username)
    • getUuid

      @Nullable UUID getUuid()
      Returns the uuid associated with this connection. This is set once the connection enters the State.PLAY state.
      Returns:
      uuid, set when entering the State.PLAY state
    • setUuid

      void setUuid(UUID uuid)
    • getPipeline

      ProtocolPipeline getPipeline()
      Returns the user's pipeline.
      Returns:
      protocol pipeline
    • setPipeline

      void setPipeline(ProtocolPipeline pipeline)