public class Ingredient extends java.lang.Object implements java.util.function.Predicate<ItemStack>
Modifier and Type | Class and Description |
---|---|
static interface |
Ingredient.IItemList |
static class |
Ingredient.SingleItemList |
static class |
Ingredient.TagList |
Modifier and Type | Field and Description |
---|---|
private Ingredient.IItemList[] |
acceptedItems |
static Ingredient |
EMPTY |
private static java.util.Set<Ingredient> |
INSTANCES |
private static java.util.function.Predicate<? super Ingredient.IItemList> |
IS_EMPTY |
private boolean |
isSimple |
private boolean |
isVanilla |
private ItemStack[] |
matchingStacks |
private it.unimi.dsi.fastutil.ints.IntList |
matchingStacksPacked |
Modifier | Constructor and Description |
---|---|
protected |
Ingredient(java.util.stream.Stream<? extends Ingredient.IItemList> itemLists) |
Modifier and Type | Method and Description |
---|---|
static Ingredient |
deserialize(com.google.gson.JsonElement json) |
static Ingredient.IItemList |
deserializeItemList(com.google.gson.JsonObject json) |
private void |
determineMatchingStacks() |
static Ingredient |
fromItemListStream(java.util.stream.Stream<? extends Ingredient.IItemList> stream) |
static Ingredient |
fromItems(IItemProvider... itemsIn) |
static Ingredient |
fromStacks(ItemStack... stacks) |
static Ingredient |
fromTag(Tag<Item> tagIn) |
ItemStack[] |
getMatchingStacks() |
IIngredientSerializer<? extends Ingredient> |
getSerializer() |
it.unimi.dsi.fastutil.ints.IntList |
getValidItemStacksPacked() |
boolean |
hasNoMatchingItems() |
protected void |
invalidate() |
static void |
invalidateAll() |
boolean |
isSimple() |
boolean |
isVanilla() |
static Ingredient |
merge(java.util.Collection<Ingredient> parts) |
static Ingredient |
read(PacketBuffer buffer) |
com.google.gson.JsonElement |
serialize() |
boolean |
test(ItemStack p_test_1_) |
void |
write(PacketBuffer buffer) |
private static final java.util.Set<Ingredient> INSTANCES
private static final java.util.function.Predicate<? super Ingredient.IItemList> IS_EMPTY
public static final Ingredient EMPTY
private final Ingredient.IItemList[] acceptedItems
private ItemStack[] matchingStacks
private it.unimi.dsi.fastutil.ints.IntList matchingStacksPacked
private final boolean isSimple
private final boolean isVanilla
protected Ingredient(java.util.stream.Stream<? extends Ingredient.IItemList> itemLists)
public static void invalidateAll()
public ItemStack[] getMatchingStacks()
private void determineMatchingStacks()
public boolean test(@Nullable ItemStack p_test_1_)
test
in interface java.util.function.Predicate<ItemStack>
public it.unimi.dsi.fastutil.ints.IntList getValidItemStacksPacked()
public final void write(PacketBuffer buffer)
public com.google.gson.JsonElement serialize()
public boolean hasNoMatchingItems()
protected void invalidate()
public boolean isSimple()
public final boolean isVanilla()
public IIngredientSerializer<? extends Ingredient> getSerializer()
public static Ingredient fromItemListStream(java.util.stream.Stream<? extends Ingredient.IItemList> stream)
public static Ingredient fromItems(IItemProvider... itemsIn)
public static Ingredient fromStacks(ItemStack... stacks)
public static Ingredient fromTag(Tag<Item> tagIn)
public static Ingredient read(PacketBuffer buffer)
public static Ingredient deserialize(@Nullable com.google.gson.JsonElement json)
public static Ingredient.IItemList deserializeItemList(com.google.gson.JsonObject json)
public static Ingredient merge(java.util.Collection<Ingredient> parts)