Interface DefaultedTag<T>

All Superinterfaces:
Keyed, ResourceKeyed, Tag<T>

public interface DefaultedTag<T> extends Tag<T>
A Tag paired with the RegistryHolder.
  • Method Details

    • of

      static <T> DefaultedTag<T> of(DefaultedRegistryType<T> registryType, ResourceKey location)
    • defaultHolder

      Supplier<RegistryHolder> defaultHolder()
    • values

      default Stream<T> values()
      Returns the Stream of values tagged by this tag.

      Great care needs to be made in calling this method with any uncertainty as to if the Tag.registry() will exist in the holder. Should the key lack a value, a ValueNotFoundException will be thrown. Therefore, it is advised to call findValues() instead.

      Returns:
      The Stream of values
    • findValues

      default Stream<T> findValues()
      Returns the Stream of values tagged by this tag in the holder if it contains this tag's Tag.registry(), or Stream.empty() otherwise.
      Returns:
      The Stream of values
    • contains

      boolean contains(T value)
      Returns whether this tag is associated with the given value.
      Parameters:
      value - The value
      Returns:
      true if this tag is associated with the given value