Class MinecraftKey

java.lang.Object
com.comphenix.protocol.wrappers.MinecraftKey

public class MinecraftKey extends Object
Represents a MinecraftKey in 1.9.

Keys are in the format prefix:key

  • Constructor Details

    • MinecraftKey

      public MinecraftKey(String prefix, String key)
      Constructs a new key with a given prefix and key.
      Parameters:
      prefix - The prefix, usually minecraft.
      key - The key, the part we care about
    • MinecraftKey

      public MinecraftKey(String key)
      Constructs a new key with minecraft prefix and a key.
      Parameters:
      key - The key
  • Method Details

    • fromHandle

      public static MinecraftKey fromHandle(Object handle)
      Creates a MinecraftKey wrapper from a Minecraft handle.
      Parameters:
      handle - The handle
      Returns:
      The resulting key
    • fromEnum

      @Deprecated public static MinecraftKey fromEnum(Enum<?> value)
      Deprecated.
      This isn't accurate in all cases
      Creates a MinecraftKey wrapper from an Enum constant. The resulting key is lower case, with underscores replaced by periods.
      Parameters:
      value - The value
      Returns:
      The resulting key
    • getPrefix

      public String getPrefix()
      Gets the prefix of this MinecraftKey. It is minecraft by default.
      Returns:
      The prefix
    • getKey

      public String getKey()
      Gets the key of this MinecraftKey. It is generally the important part.
      Returns:
      The key
    • getFullKey

      public String getFullKey()
      Gets the full key of this MinecraftKey. It is in the format of prefix:key
      Returns:
      The full key
    • getEnumFormat

      @Deprecated public String getEnumFormat()
      Deprecated.
      This isn't accurate in all cases
      Returns this key back into Enum format, upper case with periods replaced by underscores.
      Returns:
      The enum format
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getConverter

      public static EquivalentConverter<MinecraftKey> getConverter()