Class StrictNBTIngredient

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

public class StrictNBTIngredient extends Ingredient
Ingredient that matches the given stack, performing an exact NBT match. Use PartialNBTIngredient if you need partial match.
  • Field Details

  • Constructor Details

    • StrictNBTIngredient

      protected StrictNBTIngredient(ItemStack stack)
  • Method Details

    • of

      public static StrictNBTIngredient of(ItemStack stack)
      Creates a new ingredient matching the given stack and tag
    • getStack

      public ItemStack getStack()
    • areStacksEqual

      protected boolean areStacksEqual(ItemStack left, ItemStack right)
      Overrides:
      areStacksEqual in class Ingredient
    • compareStacksWithNbt

      private static boolean compareStacksWithNbt(ItemStack left, ItemStack right)
    • 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