Interface ResourceKey

All Superinterfaces:
Comparable<Key>, net.kyori.examination.Examinable, Key, Keyed, Namespaced, Wrapper

@NullMarked @AsOf("2.3.0") public interface ResourceKey extends Key, Keyed, Wrapper
This interface represents a key for a biome resource in the game. It uses the @AsOf annotation to indicate the version since the interface or its methods have been present or modified.
Since:
0.0.1
  • Field Details

  • Method Details

    • namespace

      @AsOf("0.0.15") @Namespace String namespace()
      The namespace portion of this key (e.g. "minecraft", "wyck").
      Specified by:
      namespace in interface Key
      Specified by:
      namespace in interface Namespaced
    • path

      @AsOf("0.0.15") @Value String path()
      The path portion of this key.
    • resourceLocation

      @AsOf("2.0.0") Object resourceLocation()
      Underlying Minecraft Identifier.
      Returns:
      the underlying Minecraft Identifier
      Since:
      2.0.0
    • identifier

      @AsOf("2.4.1") <T> T identifier()
      The underlying Minecraft Identifier.
      Type Parameters:
      T - the type of the underlying Minecraft Identifier
      Returns:
      the underlying Minecraft Identifier
      Since:
      2.4.1
    • value

      @AsOf("2.2.1") @Value default String value()
      Returns the path portion of this key.
      Specified by:
      value in interface Key
      Returns:
      the path portion of this key
      Since:
      2.2.1
    • asString

      @AsOf("2.2.1") default String asString()
      Returns the string representation of this key in the format "namespace:path".
      Specified by:
      asString in interface Key
      Returns:
      the string representation of this key
      Since:
      2.2.1
    • key

      @AsOf("0.0.6") default Key key()
      Returns a Key object representing this ResourceKey.
      Specified by:
      key in interface Key
      Specified by:
      key in interface Keyed
      Returns:
      a Key object representing this ResourceKey
      Since:
      0.0.6
    • toMinecraft

      @AsOf("2.3.0") default Object toMinecraft()
      Returns the underlying Minecraft object that this ResourceKey wraps.
      Specified by:
      toMinecraft in interface Wrapper
      Returns:
      the underlying Minecraft object that this ResourceKey wraps
      Since:
      2.3.0
    • of

      @AsOf("0.0.1") static ResourceKey of(String namespace, String path)
      Creates a new ResourceKey from the given namespace and path.
      Parameters:
      namespace - the namespace for the resource location
      path - the path for the resource location
      Returns:
      a new ResourceKey with the given namespace and path
      Since:
      0.0.1
    • of

      @AsOf("2.3.0") static ResourceKey of(String string)
      Creates a new ResourceKey from the given string.
      Parameters:
      string - the string to create the ResourceKey from
      Returns:
      a new ResourceKey with the given string
      Since:
      2.3.0
    • of

      @AsOf("3.3.0") static ResourceKey of(Key key)
      Creates a new ResourceKey from the given Key.
      Parameters:
      key - the Key to create the ResourceKey from
      Returns:
      a new ResourceKey with the given Key
      Since:
      3.3.0
    • wyck

      @AsOf("0.0.8") static ResourceKey wyck(String path)
      Creates a new ResourceKey in the "wyck" namespace with the given path.
      Parameters:
      path - the path for the resource location
      Returns:
      a new ResourceKey with the "wyck" namespace and the given path
    • minecraft

      @AsOf("2.3.0") static ResourceKey minecraft(String path)
      Creates a new ResourceKey in the "minecraft" namespace with the given path.
      Parameters:
      path - the path for the resource location
      Returns:
      a new ResourceKey with the "minecraft" namespace and the given path
      Since:
      2.3.0
    • fromString

      @AsOf("0.0.15") static ResourceKey fromString(String keyString)
      Creates a new ResourceKey from the given string representation. The string should be in the format "namespace:path".
      Parameters:
      keyString - the string representation of the ResourceKey
      Returns:
      a new ResourceKey with the given string representation
      Since:
      0.0.15