Interface VersionProvider

All Superinterfaces:
Provider
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface VersionProvider extends Provider
  • Method Details

    • getClientProtocol

      default ProtocolVersion getClientProtocol(UserConnection connection)
      Optionally allows platforms to specify the client version of a user. This is needed when the platform supports connecting other version types then VersionType.RELEASE to the server.
      Parameters:
      connection - connection
      Returns:
      client protocol version, or null if handshake packet should be used
    • getServerProtocol

      default ProtocolVersion getServerProtocol(UserConnection connection)
      Calls getClosestServerProtocol(UserConnection) and catches any exceptions by returning null.
      Parameters:
      connection - connection
      Returns:
      closest server protocol version to the user's protocol version
    • getClosestServerProtocol

      ProtocolVersion getClosestServerProtocol(UserConnection connection) throws Exception
      Returns the closest server protocol version to the user's protocol version. On non-proxy servers, this returns the actual server version.
      Parameters:
      connection - connection
      Returns:
      closest server protocol version to the user's protocol version
      Throws:
      Exception