Interface TagKey<T>

All Superinterfaces:
Keyed

public sealed interface TagKey<T> extends Keyed
  • Method Details

    • codec

      static <T> Codec<TagKey<T>> codec(Registries.Selector<T> selector)
    • networkType

      static <T> NetworkBuffer.Type<TagKey<T>> networkType(Registries.Selector<T> selector)
    • ofHash

      static <T> TagKey<T> ofHash(String hashedKey)
    • of

      static <T> TagKey<T> of(@KeyPattern String key)
      Creates a tag key from an unhashed string. The key syntax is validated, tag existence is not. A tag key is only a typed name. Looking up a tag that does not exist returns null.
      Type Parameters:
      T - the registry entry type
      Parameters:
      key - the tag key without a leading #
      Returns:
      the tag key
      Throws:
      IllegalArgumentException - if key is invalid
      NullPointerException - if key is null
    • of

      static <T> TagKey<T> of(Key key)
      Creates a tag key from an unhashed key without checking that the tag exists. See of(String).
      Type Parameters:
      T - the registry entry type
      Parameters:
      key - the tag key
      Returns:
      the tag key
      Throws:
      NullPointerException - if key is null
    • hashedKey

      default String hashedKey()