Enum Class ProtocolVersion

java.lang.Object
java.lang.Enum<ProtocolVersion>
one.pkg.tiny.utils.minecraft.ProtocolVersion
All Implemented Interfaces:
Serializable, Comparable<ProtocolVersion>, Constable

public enum ProtocolVersion extends Enum<ProtocolVersion>
Represents the Minecraft Java Edition protocol version mapping table.

This mapping table is used to match protocol numbers to the lowest formal version when multiple versions share the same protocol number.

The mapping only includes protocol numbers for official release versions. It excludes protocol numbers for snapshot versions, pre-release versions, and April Fools' versions.

Note: For the most recent Minecraft releases, the protocol number may be unrecognized unless the dependency library is updated. In such cases, the protocol number is assumed to be that of the most recent release.

  • Enum Constant Details

  • Method Details

    • values

      public static ProtocolVersion[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

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

      public static ProtocolVersion fromProtocolVersion(int protocolVersion)
      Returns the corresponding ProtocolVersion for the given protocol number.
      Parameters:
      protocolVersion - the protocol number to look up
      Returns:
      the ProtocolVersion mapped to the given protocol number, or UNKNOWN if the protocol is not supported or recognized
    • getProtocolVersion

      public int getProtocolVersion()
      Returns the protocol number for this ProtocolVersion.
      Returns:
      the protocol number