Class ChildBasedIngredient

java.lang.Object
net.minecraft.world.item.crafting.Ingredient
net.neoforged.neoforge.common.crafting.ChildBasedIngredient
All Implemented Interfaces:
Predicate<ItemStack>
Direct Known Subclasses:
CompoundIngredient, DifferenceIngredient, IntersectionIngredient

public abstract class ChildBasedIngredient extends Ingredient
Intermediary class for easing handling of ingredients that make use of multiple children
  • Field Details

    • children

      protected final List<Ingredient> children
    • isSimple

      private final boolean isSimple
    • synchronizeWithContents

      private final boolean synchronizeWithContents
    • filteredMatchingStacks

      @Nullable private @Nullable ItemStack[] filteredMatchingStacks
  • Constructor Details

  • Method Details

    • generateMatchingStacks

      protected abstract Stream<ItemStack> generateMatchingStacks()
    • testComplex

      protected abstract boolean testComplex(@Nullable @Nullable ItemStack stack)
    • getItems

      public final ItemStack[] getItems()
      Overrides:
      getItems in class Ingredient
    • test

      public final boolean test(@Nullable @Nullable ItemStack stack)
      Specified by:
      test in interface Predicate<ItemStack>
      Overrides:
      test in class Ingredient
    • isSimple

      public final boolean isSimple()
      Overrides:
      isSimple in class Ingredient
    • synchronizeWithContents

      public final boolean synchronizeWithContents()
      Description copied from class: Ingredient
      Returns if true, this ingredient will be synchronized using its contents, as in vanilla, otherwise it will be synchronized via the codec.
      Overrides:
      synchronizeWithContents in class Ingredient
      Returns:
      if true, this ingredient will be synchronized using its contents, as in vanilla, otherwise it will be synchronized via the codec
    • getChildren

      public final List<Ingredient> getChildren()