Class NameKey

java.lang.Object
eu.endercentral.crazy_advancements.NameKey

public class NameKey extends Object
Represents a Unique Name
Author:
Axel
  • Constructor Details

    • NameKey

      public NameKey(String namespace, String key)
      Constructor for creating a NameKey
      Parameters:
      namespace - The namespace, choose something representing your plugin/project/subproject
      key - The Unique key inside your namespace
    • NameKey

      public NameKey(String key)
      Constructor for creating a NameKey
      Parameters:
      key - The key inside the default namespace "minecraft" or a NameSpacedKey seperated by a colon
    • NameKey

      public NameKey(net.minecraft.resources.MinecraftKey from)
      Generates a NameKey
      Parameters:
      from - The MinecraftKey to generate from
  • Method Details

    • getNamespace

      public String getNamespace()
      Gets the namespace
      Returns:
      The namespace
    • getKey

      public String getKey()
      Gets the key
      Returns:
      The key
    • isSimilar

      public boolean isSimilar(NameKey anotherNameKey)
      Compares to another key
      Parameters:
      anotherNameKey - NameKey to compare to
      Returns:
      true if both NameKeys match each other
    • getMinecraftKey

      public net.minecraft.resources.MinecraftKey getMinecraftKey()
      Gets the MinecraftKey equivalent of this NameKey
      Returns:
      A MinecraftKey representation of this NameKey
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object