Class CompoundIngredient

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

public class CompoundIngredient extends Ingredient
Ingredient that matches if any of the child ingredients match
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<CompoundIngredient> CODEC
    • DIRECT_CODEC

      public static final com.mojang.serialization.Codec<CompoundIngredient> DIRECT_CODEC
    • CODEC_NONEMPTY

      public static final com.mojang.serialization.Codec<CompoundIngredient> CODEC_NONEMPTY
    • DIRECT_CODEC_NONEMPTY

      public static final com.mojang.serialization.Codec<CompoundIngredient> DIRECT_CODEC_NONEMPTY
    • children

      private final List<Ingredient> children
    • isSimple

      private final boolean isSimple
    • synchronizeWithContents

      private final boolean synchronizeWithContents
  • Constructor Details

    • CompoundIngredient

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

    • of

      public static Ingredient of(Ingredient... children)
      Creates a compound ingredient from the given list of ingredients
    • 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
    • isSimple

      public boolean isSimple()
      Overrides:
      isSimple 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
    • getChildren

      @NotNull public @NotNull List<Ingredient> getChildren()