Class OrHolderSet<T>

java.lang.Object
net.minecraftforge.registries.holdersets.CompositeHolderSet<T>
net.minecraftforge.registries.holdersets.OrHolderSet<T>
All Implemented Interfaces:
Iterable<Holder<T>>, HolderSet<T>, IForgeHolderSet<T>, ICustomHolderSet<T>

public class OrHolderSet<T> extends CompositeHolderSet<T>

Holderset that represents a union of other holdersets. Json format:

 {
   "type": "forge:or",
   "values":
   [
      // list of sub-holdersets (strings, lists, or objects)
   ]
 }
 
  • Constructor Details

  • Method Details

    • codec

      public static <T> com.mojang.serialization.Codec<? extends ICustomHolderSet<T>> codec(ResourceKey<? extends Registry<T>> registryKey, com.mojang.serialization.Codec<Holder<T>> holderCodec, boolean forceList)
    • type

      public HolderSetType type()
      Description copied from interface: ICustomHolderSet
      Returns HolderSetType registered to ForgeRegistries.HOLDER_SET_TYPES.
      Returns:
      HolderSetType registered to ForgeRegistries.HOLDER_SET_TYPES
    • createSet

      protected Set<Holder<T>> createSet()
      Description copied from class: CompositeHolderSet
      Returns immutable Set of Holders given this composite holderset's component holdersets.
      Specified by:
      createSet in class CompositeHolderSet<T>
      Returns:
      immutable Set of Holders given this composite holderset's component holdersets
    • toString

      public String toString()
      Overrides:
      toString in class Object