Interface Ingredient
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceIngredient.BuilderBuilder forIngredients.static interfaceIngredient.Factory
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static Ingredient.Builderbuilder()Creates a newIngredient.Builderto build anIngredient.List<ItemStackSnapshot>displayedItems()Returns the list ofItemStacks used to display the ingredient in a recipe.static Ingredientempty()An empty ingredient.static Ingredientof(@Nullable ItemStack... items)Creates a newIngredientfor the providedItemStacks.static Ingredientof(@Nullable ItemStackSnapshot... items)Creates a newIngredientfor the providedItemStackSnapshots.static Ingredientof(@Nullable ItemType... itemTypes)Creates a newIngredientfor the providedItemTypes.static Ingredientof(@Nullable DefaultedRegistryReference<? extends ItemType>... itemTypes)Creates a newIngredientfor the providedItemTypes.static Ingredientof(ResourceKey key)static Ingredientof(ResourceKey key, Predicate<ItemStack> predicate, ItemStack... exemplaryStacks)booleantest(ItemStack itemStack)
-
-
-
Method Detail
-
empty
static Ingredient empty()
An empty ingredient.- Returns:
- The empty ingredient
-
displayedItems
List<ItemStackSnapshot> displayedItems()
Returns the list ofItemStacks used to display the ingredient in a recipe. These are not necessarily all the items that this Ingredient can match.- Returns:
- The list of items to display the Ingredient in a recipe.
-
builder
static Ingredient.Builder builder()
Creates a newIngredient.Builderto build anIngredient.- Returns:
- The new builder
-
of
static Ingredient of(@Nullable ItemType... itemTypes)
Creates a newIngredientfor the providedItemTypes.- Parameters:
itemTypes- The items- Returns:
- The new ingredient
-
of
static Ingredient of(@Nullable ItemStack... items)
Creates a newIngredientfor the providedItemStacks.- Parameters:
items- The items- Returns:
- The new ingredient
-
of
static Ingredient of(@Nullable ItemStackSnapshot... items)
Creates a newIngredientfor the providedItemStackSnapshots.- Parameters:
items- The item- Returns:
- The new ingredient
-
of
@SafeVarargs static Ingredient of(@Nullable DefaultedRegistryReference<? extends ItemType>... itemTypes)
Creates a newIngredientfor the providedItemTypes.- Parameters:
itemTypes- The items- Returns:
- The new ingredient
-
of
static Ingredient of(ResourceKey key, Predicate<ItemStack> predicate, ItemStack... exemplaryStacks)
Creates a newIngredientfor the providedPredicateand exemplaryItemStacks.Note: Predicate ingredients may not be fully supported for all recipe types
- Parameters:
key- A unique resource keypredicate- The predicateexemplaryStacks- The exemplary items- Returns:
- The new ingredient
-
of
static Ingredient of(ResourceKey key)
- Parameters:
key- The key- Returns:
- The new ingredient
-
-