Class AndHolderSet<T>

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

public class AndHolderSet<T> extends CompositeHolderSet<T>

Holderset that represents an intersection of other holdersets. Json format:

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

  • Method Details

    • codec

      public static <T> com.mojang.serialization.MapCodec<? 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
      invalid reference
      ForgeRegistries.HOLDER_SET_TYPES
      .
      Returns:
      HolderSetType registered to
      invalid reference
      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