Enum ProtocolVersion

    • Field Detail

      • MINIMUM_VERSION

        public static final ProtocolVersion MINIMUM_VERSION
        Represents the lowest supported version.
      • MAXIMUM_VERSION

        public static final ProtocolVersion MAXIMUM_VERSION
        Represents the highest supported version.
      • SUPPORTED_VERSION_STRING

        public static final String SUPPORTED_VERSION_STRING
        The user-friendly representation of the lowest and highest supported versions.
      • SUPPORTED_VERSIONS

        public static final Set<ProtocolVersion> SUPPORTED_VERSIONS
        A set containing all the protocols that the proxy actually supports, excluding special-purpose "versions" like LEGACY and UNKNOWN.
    • Method Detail

      • values

        public static ProtocolVersion[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (ProtocolVersion c : ProtocolVersion.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static ProtocolVersion valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
        NullPointerException - if the argument is null
      • protocol

        public int protocol()
        Returns the protocol as an int.
        Returns:
        the protocol version
      • versionIntroducedIn

        public String versionIntroducedIn()
        Returns the user-friendly name of the version this protocol was introduced in.
        Returns:
        the version name
      • mostRecentSupportedVersion

        public String mostRecentSupportedVersion()
        Returns the user-friendly name of the last version this protocol is valid for.
        Returns:
        the version name
      • supportedVersions

        public List<String> supportedVersions()
        Returns all versions this protocol is valid for.
        Returns:
        the version names
      • byMinecraftProtocolVersion

        public static ProtocolVersion byMinecraftProtocolVersion​(int protocol)
        Gets the ProtocolVersion for the given protocol.
        Parameters:
        protocol - the protocol as an int
        Returns:
        the protocol version
      • isSupported

        public static boolean isSupported​(int protocol)
        Returns whether the protocol is supported.
        Parameters:
        protocol - the protocol as an int
        Returns:
        if the protocol supported
      • isSupported

        public static boolean isSupported​(ProtocolVersion version)
        Returns whether the ProtocolVersion is supported.
        Parameters:
        version - the protocol version
        Returns:
        if the protocol supported
      • isUnknown

        public boolean isUnknown()
        Returns whether this ProtocolVersion is unknown to the proxy.
        Returns:
        if the protocol is unknown
      • isLegacy

        public boolean isLegacy()
        Returns whether this ProtocolVersion is a legacy protocol.
        Returns:
        if the protocol is legacy