ItemStackIngredient
This class was added by a mod with mod-id mekanism
. So you need to have this mod installed if you
want to use this feature.
Importing the class
It might be required for you to import the package if you encounter any issues (like casting an Array), so better be safe than sorry and add the import at the very top of the file.
import mods.mekanism.api.ingredient.ItemStackIngredient;
Static Methods
Combines multiple ItemStackIngredients into a single ItemStackIngredient.
Returns: A single ItemStackIngredient
representing all the passed in ingredients.
Return Type: ItemStackIngredient
ItemStackIngredient.createMulti(ingredients as ItemStackIngredient[]) as ItemStackIngredient
Parameter | Type | Description |
---|---|---|
Parameter ingredients | Type ItemStackIngredient[] | Description Ingredients to combine |
Creates a ItemStackIngredient that matches a given ingredient with an amount of one.
Returns: A ItemStackIngredient that matches a
given ingredient with an amount of one.
Return Type: ItemStackIngredient
ItemStackIngredient.from(ingredient as IIngredient) as ItemStackIngredient
Parameter | Type | Description |
---|---|---|
Parameter ingredient | Type IIngredient | Description Ingredient to match |
Creates a ItemStackIngredient that matches a given ingredient with amount.
Returns: A ItemStackIngredient that matches a
given ingredient with amount.
Return Type: ItemStackIngredient
ItemStackIngredient.from(ingredient as IIngredientWithAmount) as ItemStackIngredient
Parameter | Type | Description |
---|---|---|
Parameter ingredient | Type IIngredientWithAmount | Description Ingredient and amount to match |
Creates a ItemStackIngredient out of all the ingredients in the given IngredientList.
Returns: A ItemStackIngredient made up of all
the ingredients in the given IngredientList.
Return Type: ItemStackIngredient
ItemStackIngredient.from(ingredientList as IngredientList) as ItemStackIngredient
Parameter | Type | Description |
---|---|---|
Parameter ingredientList | Type IngredientList | Description Ingredients to match |
Creates a ItemStackIngredient that matches a given item with an amount of one.
Returns: A ItemStackIngredient that matches a
given item with an amount of one.
Return Type: ItemStackIngredient
ItemStackIngredient.from(item as MCItemDefinition) as ItemStackIngredient
Parameter | Type | Description |
---|---|---|
Parameter item | Type MCItemDefinition | Description Item to match |
Creates a ItemStackIngredient that matches a given item tag with an amount of one.
Returns: A ItemStackIngredient that matches a
given item tag with an amount of one.
Return Type: ItemStackIngredient
ItemStackIngredient.from(itemTag as MCTag<MCItemDefinition>) as ItemStackIngredient
Parameter | Type | Description |
---|---|---|
Parameter itemTag | Type MCTag<MCItemDefinition> | Description Tag to match |
Creates a ItemStackIngredient that matches a given item tag with amount.
Returns: A ItemStackIngredient that matches a
given item tag with amount.
Return Type: ItemStackIngredient
ItemStackIngredient.from(itemTag as MCTagWithAmount<MCItemDefinition>) as ItemStackIngredient
Parameter | Type | Description |
---|---|---|
Parameter itemTag | Type MCTagWithAmount<MCItemDefinition> | Description Tag and amount to match |
Creates a ItemStackIngredient that matches a given item stack.
Returns: A ItemStackIngredient that matches a
given item stack.
Return Type: ItemStackIngredient
ItemStackIngredient.from(stack as IItemStack) as ItemStackIngredient
Parameter | Type | Description |
---|---|---|
Parameter stack | Type IItemStack | Description Item stack to match |
Creates a ItemStackIngredient that matches a given ingredient and amount.
Returns: A ItemStackIngredient that matches a
given ingredient and amount.
Return Type: ItemStackIngredient
ItemStackIngredient.from(ingredient as IIngredient, amount as int) as ItemStackIngredient
Parameter | Type | Description |
---|---|---|
Parameter ingredient | Type IIngredient | Description Ingredient to match |
Parameter amount | Type int | Description Amount needed |
Creates a ItemStackIngredient that matches a given item and amount.
Returns: A ItemStackIngredient that matches a
given item and amount.
Return Type: ItemStackIngredient
ItemStackIngredient.from(item as MCItemDefinition, amount as int) as ItemStackIngredient
Parameter | Type | Description |
---|---|---|
Parameter item | Type MCItemDefinition | Description Item to match |
Parameter amount | Type int | Description Amount needed |
Creates a ItemStackIngredient that matches a given item tag with a given amount.
Returns: A ItemStackIngredient that matches a
given item tag with a given amount.
Return Type: ItemStackIngredient
ItemStackIngredient.from(itemTag as MCTag<MCItemDefinition>, amount as int) as ItemStackIngredient
Parameter | Type | Description |
---|---|---|
Parameter itemTag | Type MCTag<MCItemDefinition> | Description Tag to match |
Parameter amount | Type int | Description Amount needed |
Casters
Result type | Is Implicit |
---|---|
Result type IData | Is Implicit true |
Methods
Converts this ItemStackIngredient into JSON (IData).
Returns: ItemStackIngredient as JSON.
Return Type: IData
// ItemStackIngredient.asIData() as IData
myItemStackIngredient.asIData();
OR’s this ItemStackIngredient with another ItemStackIngredient to create a multi ItemStackIngredient
Returns: Multi ItemStackIngredient that matches
both the source ItemStackIngredient and the
OR’d ItemStackIngredient.
Return Type: ItemStackIngredient
ItemStackIngredient.or(other as ItemStackIngredient) as ItemStackIngredient
Parameter | Type | Description |
---|---|---|
Parameter other | Type ItemStackIngredient | Description ItemStackIngredient to combine with. |
Operators
Returns a new ItemStackIngredient using the two ItemStackIngredient as a base.
(ing1 as ItemStackIngredient) | (ing2 as ItemStackIngredient);