Class ForgeRegistryTag<V>

java.lang.Object
net.minecraftforge.registries.ForgeRegistryTag<V>
All Implemented Interfaces:
Iterable<V>, ITag<V>

class ForgeRegistryTag<V> extends Object implements ITag<V>
  • Field Details

    • key

      private final TagKey<V> key
    • holderSet

      @Nullable private @Nullable HolderSet<V> holderSet
    • contents

      @Nullable private @Nullable List<V> contents
  • Constructor Details

    • ForgeRegistryTag

      ForgeRegistryTag(TagKey<V> key)
  • Method Details

    • getKey

      public TagKey<V> getKey()
      Specified by:
      getKey in interface ITag<V>
    • iterator

      @NotNull public @NotNull Iterator<V> iterator()
      Specified by:
      iterator in interface Iterable<V>
    • spliterator

      public Spliterator<V> spliterator()
      Specified by:
      spliterator in interface Iterable<V>
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface ITag<V>
    • size

      public int size()
      Specified by:
      size in interface ITag<V>
    • stream

      public Stream<V> stream()
      Specified by:
      stream in interface ITag<V>
    • contains

      public boolean contains(V value)
      Specified by:
      contains in interface ITag<V>
    • getRandomElement

      public Optional<V> getRandomElement(RandomSource random)
      Specified by:
      getRandomElement in interface ITag<V>
    • isBound

      public boolean isBound()
      Specified by:
      isBound in interface ITag<V>
      Returns:
      true if this tag was loaded with a value (including empty), otherwise the tag is always empty and this returns false
    • getContents

      List<V> getContents()
    • bind

      void bind(@Nullable @Nullable HolderSet<V> holderSet)
    • toString

      public String toString()
      Overrides:
      toString in class Object