Enum MinecraftVersion

java.lang.Object
java.lang.Enum<MinecraftVersion>
de.themoep.resourcepacksplugin.core.MinecraftVersion
All Implemented Interfaces:
Serializable, Comparable<MinecraftVersion>, java.lang.constant.Constable

public enum MinecraftVersion extends Enum<MinecraftVersion>
  • Enum Constant Details

  • Method Details

    • values

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

      public static MinecraftVersion 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
    • parseVersion

      public static MinecraftVersion parseVersion(String versionString) throws IllegalArgumentException
      Parse the version from a string. The string can either be a string representation of the version or the protocol number
      Parameters:
      versionString - The string representation of the version or the protocol number
      Returns:
      The MinecraftVersion
      Throws:
      IllegalArgumentException - If no version can be parsed from the string
    • getVersion

      public static MinecraftVersion getVersion(int protocolVersion)
      Get the Minecraft version from the protocol version
      Parameters:
      protocolVersion - The protocol version
      Returns:
      The Minecraft version or UNKNOWN if not known
    • getExactVersion

      public static MinecraftVersion getExactVersion(int protocolVersion)
      Gets the Minecraft version that matches the protocol version exactly
      Parameters:
      protocolVersion - The protocol version
      Returns:
      The Minecraft version or null if not known
    • toConfigString

      public String toConfigString()
      Get the human readable config string for this version which can be parsed by parseVersion
      Returns:
      The human readable config string
    • getProtocolNumber

      public int getProtocolNumber()