Class DifferenceIngredient

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

public class DifferenceIngredient extends Ingredient
Ingredient that matches everything from the first ingredient that is not included in the second ingredient
  • Field Details

  • Constructor Details

  • Method Details

    • getBase

      public Ingredient getBase()
    • getSubtracted

      public Ingredient getSubtracted()
    • isSimple

      public boolean isSimple()
      Overrides:
      isSimple in class Ingredient
    • 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
    • getStackingIds

      public it.unimi.dsi.fastutil.ints.IntList getStackingIds()
      Overrides:
      getStackingIds 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
    • of

      public static DifferenceIngredient of(Ingredient base, Ingredient subtracted)
      Gets the difference from the two ingredients
      Parameters:
      base - Ingredient the item must match
      subtracted - Ingredient the item must not match
      Returns:
      Ingredient that base anything in base that is not in subtracted