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

      public static final StreamCodec<RegistryFriendlyByteBuf,Ingredient> CONTENTS_STREAM_CODEC
    • values

      private final Ingredient.Value[] values
    • itemStacks

      @Nullable private ItemStack[] itemStacks
    • stackingIds

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

      public static final com.mojang.serialization.Codec<Ingredient> VANILLA_CODEC
      The vanilla codec that doesn't support custom Ingredient types.
    • VANILLA_MAP_CODEC

      public static final com.mojang.serialization.MapCodec<Ingredient> VANILLA_MAP_CODEC
    • CODEC

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

      private static final com.mojang.serialization.Codec<Ingredient> VANILLA_CODEC_NONEMPTY
    • 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()
    • isEmpty

      public boolean isEmpty()
    • equals

      public boolean equals(Object p_300457_)
      Overrides:
      equals in class Object
    • 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_)
    • checkInvalidation

      public final boolean checkInvalidation()
    • markValid

      protected final void markValid()
    • invalidate

      protected void invalidate()
    • isSimple

      public boolean isSimple()
    • isVanilla

      public final boolean isVanilla()
    • serializer

      public IIngredientSerializer<? extends Ingredient> serializer()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • codec

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