Class ProtocolVersionDetector

java.lang.Object
com.viaversion.viafabricplus.protocoltranslator.util.ProtocolVersionDetector

public final class ProtocolVersionDetector extends Object
This class can be used to detect the protocol version of a server without connecting to it.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.viaversion.viaversion.api.protocol.version.ProtocolVersion
    get(net.minecraft.client.multiplayer.resolver.ServerAddress serverAddress, InetSocketAddress socketAddress, com.viaversion.viaversion.api.protocol.version.ProtocolVersion clientVersion)
    Detects the protocol version of a server

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ProtocolVersionDetector

      public ProtocolVersionDetector()
  • Method Details

    • get

      public static com.viaversion.viaversion.api.protocol.version.ProtocolVersion get(net.minecraft.client.multiplayer.resolver.ServerAddress serverAddress, InetSocketAddress socketAddress, com.viaversion.viaversion.api.protocol.version.ProtocolVersion clientVersion) throws Exception
      Detects the protocol version of a server
      Parameters:
      serverAddress - The address of the server
      clientVersion - The version of the client
      Returns:
      The protocol version of the server
      Throws:
      Exception