Class Ingredient

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

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
    • CODEC

      public static final com.mojang.serialization.Codec<Ingredient> CODEC
    • CODEC_NONEMPTY

      public static final com.mojang.serialization.Codec<Ingredient> CODEC_NONEMPTY
    • 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(boolean p_299391_)
    • isEmpty

      public boolean isEmpty()
    • equals

      public boolean equals(Object p_300457_)
      Overrides:
      equals in class Object
    • checkInvalidation

      public final boolean checkInvalidation()
    • markValid

      protected final void markValid()
    • invalidate

      protected void invalidate()
    • isSimple

      public boolean isSimple()
    • isVanilla

      public final boolean isVanilla()
    • 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_)
    • codec

      private static com.mojang.serialization.Codec<Ingredient> codec(boolean p_298496_)
    • merge

      public static Ingredient merge(Collection<Ingredient> parts)