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 interface
Ingredient.IItemList
static class
Ingredient.SingleItemList
static class
Ingredient.TagList
-
Field Summary
Fields Modifier and Type Field Description static Ingredient
EMPTY
private static java.util.Set<Ingredient>
INSTANCES
private boolean
isSimple
private boolean
isVanilla
private ItemStack[]
itemStacks
private it.unimi.dsi.fastutil.ints.IntList
stackingIds
private Ingredient.IItemList[]
values
-
Constructor Summary
Constructors Modifier Constructor Description protected
Ingredient(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 void
dissolve()
static Ingredient
fromJson(com.google.gson.JsonElement p_199802_0_)
static Ingredient
fromNetwork(PacketBuffer p_199566_0_)
static Ingredient
fromValues(java.util.stream.Stream<? extends Ingredient.IItemList> p_209357_0_)
ItemStack[]
getItems()
IIngredientSerializer<? extends Ingredient>
getSerializer()
it.unimi.dsi.fastutil.ints.IntList
getStackingIds()
protected void
invalidate()
static void
invalidateAll()
boolean
isEmpty()
boolean
isSimple()
boolean
isVanilla()
static Ingredient
merge(java.util.Collection<Ingredient> parts)
static Ingredient
of(java.util.stream.Stream<ItemStack> p_234819_0_)
static Ingredient
of(ItemStack... p_193369_0_)
static Ingredient
of(ITag<Item> p_199805_0_)
static Ingredient
of(IItemProvider... p_199804_0_)
boolean
test(ItemStack p_test_1_)
com.google.gson.JsonElement
toJson()
void
toNetwork(PacketBuffer p_199564_1_)
static Ingredient.IItemList
valueFromJson(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:
test
in 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)
-
-