Class Ingredient

java.lang.Object
net.minecraft.world.item.crafting.Ingredient
All Implemented Interfaces:
Predicate<ItemStack>
Direct Known Subclasses:
AbstractIngredient

public class Ingredient extends Object implements Predicate<ItemStack>
  • Field Details

    • INVALIDATION_COUNTER

      private static final AtomicInteger INVALIDATION_COUNTER
    • EMPTY

      public static final Ingredient EMPTY
    • values

      private final Ingredient.Value[] values
    • itemStacks

      @Nullable private ItemStack[] itemStacks
    • stackingIds

      @Nullable private it.unimi.dsi.fastutil.ints.IntList stackingIds
    • invalidationCounter

      private int invalidationCounter
    • isVanilla

      private final boolean isVanilla
  • Constructor Details

  • Method Details

    • invalidateAll

      public static void invalidateAll()
    • getItems

      public ItemStack[] getItems()
    • test

      public boolean test(@Nullable ItemStack p_43914_)
      Specified by:
      test in interface Predicate<ItemStack>
    • getStackingIds

      public it.unimi.dsi.fastutil.ints.IntList getStackingIds()
    • toNetwork

      public final void toNetwork(FriendlyByteBuf p_43924_)
    • toJson

      public com.google.gson.JsonElement toJson()
    • isEmpty

      public boolean isEmpty()
    • checkInvalidation

      public final boolean checkInvalidation()
    • markValid

      protected final void markValid()
    • invalidate

      protected void invalidate()
    • isSimple

      public boolean isSimple()
    • isVanilla

      public final boolean isVanilla()
    • getSerializer

      public IIngredientSerializer<? extends Ingredient> getSerializer()
    • fromValues

      public static Ingredient fromValues(Stream<? extends Ingredient.Value> p_43939_)
    • of

      public static Ingredient of()
    • of

      public static Ingredient of(ItemLike... p_43930_)
    • of

      public static Ingredient of(ItemStack... p_43928_)
    • of

      public static Ingredient of(Stream<ItemStack> p_43922_)
    • of

      public static Ingredient of(TagKey<Item> p_204133_)
    • fromNetwork

      public static Ingredient fromNetwork(FriendlyByteBuf p_43941_)
    • fromJson

      public static Ingredient fromJson(@Nullable com.google.gson.JsonElement p_43918_)
    • fromJson

      public static Ingredient fromJson(@Nullable com.google.gson.JsonElement p_289022_, boolean p_288974_)
    • valueFromJson

      public static Ingredient.Value valueFromJson(com.google.gson.JsonObject p_289797_)
    • merge

      public static Ingredient merge(Collection<Ingredient> parts)