Class IntersectionIngredient

java.lang.Object
net.minecraft.world.item.crafting.Ingredient
net.neoforged.neoforge.common.crafting.IntersectionIngredient
All Implemented Interfaces:
Predicate<ItemStack>

public class IntersectionIngredient extends Ingredient
Ingredient that matches if all child ingredients match
  • Field Details

  • Constructor Details

    • IntersectionIngredient

      protected IntersectionIngredient(List<Ingredient> children)
  • Method Details

    • getChildren

      public List<Ingredient> getChildren()
    • of

      public static Ingredient of(Ingredient... ingredients)
      Gets an intersection ingredient
      Parameters:
      ingredients - List of ingredients to match
      Returns:
      Ingredient that only matches if all the passed ingredients match
    • getItems

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

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

      public 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
    • isSimple

      public boolean isSimple()
      Overrides:
      isSimple in class Ingredient