Package net.minecraft.item.crafting
Class Ingredient
- java.lang.Object
-
- net.minecraft.item.crafting.Ingredient
-
- All Implemented Interfaces:
java.util.function.Predicate<ItemStack>
- Direct Known Subclasses:
CompoundIngredient,NBTIngredient
public class Ingredient extends java.lang.Object implements java.util.function.Predicate<ItemStack>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceIngredient.IItemListstatic classIngredient.SingleItemListstatic classIngredient.TagList
-
Field Summary
Fields Modifier and Type Field Description static IngredientEMPTYprivate static java.util.Set<Ingredient>INSTANCESprivate booleanisSimpleprivate booleanisVanillaprivate ItemStack[]itemStacksprivate it.unimi.dsi.fastutil.ints.IntListstackingIdsprivate Ingredient.IItemList[]values
-
Constructor Summary
Constructors Modifier Constructor Description protectedIngredient(java.util.stream.Stream<? extends Ingredient.IItemList> p_i49381_1_)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private voiddissolve()static IngredientfromJson(com.google.gson.JsonElement p_199802_0_)static IngredientfromNetwork(PacketBuffer p_199566_0_)static IngredientfromValues(java.util.stream.Stream<? extends Ingredient.IItemList> p_209357_0_)ItemStack[]getItems()IIngredientSerializer<? extends Ingredient>getSerializer()it.unimi.dsi.fastutil.ints.IntListgetStackingIds()protected voidinvalidate()static voidinvalidateAll()booleanisEmpty()booleanisSimple()booleanisVanilla()static Ingredientmerge(java.util.Collection<Ingredient> parts)static Ingredientof(java.util.stream.Stream<ItemStack> p_234819_0_)static Ingredientof(ItemStack... p_193369_0_)static Ingredientof(ITag<Item> p_199805_0_)static Ingredientof(IItemProvider... p_199804_0_)booleantest(ItemStack p_test_1_)com.google.gson.JsonElementtoJson()voidtoNetwork(PacketBuffer p_199564_1_)static Ingredient.IItemListvalueFromJson(com.google.gson.JsonObject p_199803_0_)
-
-
-
Field Detail
-
INSTANCES
private static final java.util.Set<Ingredient> INSTANCES
-
EMPTY
public static final Ingredient EMPTY
-
values
private final Ingredient.IItemList[] values
-
itemStacks
private ItemStack[] itemStacks
-
stackingIds
private it.unimi.dsi.fastutil.ints.IntList stackingIds
-
isSimple
private final boolean isSimple
-
isVanilla
private final boolean isVanilla
-
-
Constructor Detail
-
Ingredient
protected Ingredient(java.util.stream.Stream<? extends Ingredient.IItemList> p_i49381_1_)
-
-
Method Detail
-
invalidateAll
public static void invalidateAll()
-
getItems
public ItemStack[] getItems()
-
dissolve
private void dissolve()
-
test
public boolean test(@Nullable ItemStack p_test_1_)- Specified by:
testin interfacejava.util.function.Predicate<ItemStack>
-
getStackingIds
public it.unimi.dsi.fastutil.ints.IntList getStackingIds()
-
toNetwork
public final void toNetwork(PacketBuffer p_199564_1_)
-
toJson
public com.google.gson.JsonElement toJson()
-
isEmpty
public boolean isEmpty()
-
invalidate
protected void invalidate()
-
isSimple
public boolean isSimple()
-
isVanilla
public final boolean isVanilla()
-
getSerializer
public IIngredientSerializer<? extends Ingredient> getSerializer()
-
fromValues
public static Ingredient fromValues(java.util.stream.Stream<? extends Ingredient.IItemList> p_209357_0_)
-
of
public static Ingredient of(IItemProvider... p_199804_0_)
-
of
public static Ingredient of(ItemStack... p_193369_0_)
-
of
public static Ingredient of(java.util.stream.Stream<ItemStack> p_234819_0_)
-
of
public static Ingredient of(ITag<Item> p_199805_0_)
-
fromNetwork
public static Ingredient fromNetwork(PacketBuffer p_199566_0_)
-
fromJson
public static Ingredient fromJson(@Nullable com.google.gson.JsonElement p_199802_0_)
-
valueFromJson
public static Ingredient.IItemList valueFromJson(com.google.gson.JsonObject p_199803_0_)
-
merge
public static Ingredient merge(java.util.Collection<Ingredient> parts)
-
-