Home Migration Guide Getting Started With Scripts Commands Examples
Generic JSON Recipes

PigmentStackIngredient

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.

script.zs
import mods.mekanism.api.ingredient.ChemicalStackIngredient.PigmentStackIngredient;

Implemented Interfaces

PigmentStackIngredient implements the following interfaces. That means all methods defined in these interfaces are also available in PigmentStackIngredient

Static Methods

Combines multiple PigmentStackIngredient s into a single PigmentStackIngredient .

Returns: A single PigmentStackIngredient representing all the passed in ingredients.
Return Type: PigmentStackIngredient

script.zs
PigmentStackIngredient.createMulti(ingredients as PigmentStackIngredient[]) as PigmentStackIngredient
ParameterTypeDescription
Parameter
ingredients
Type
PigmentStackIngredient[]
Description
Ingredients to combine

Creates a PigmentStackIngredient that matches a given pigment stack.

Returns: A PigmentStackIngredient that matches a given pigment stack.
Return Type: PigmentStackIngredient

script.zs
PigmentStackIngredient.from(instance as PigmentStack) as PigmentStackIngredient
ParameterTypeDescription
Parameter
instance
Type
PigmentStack
Description
Pigment stack to match

Creates a PigmentStackIngredient that matches a given pigment tag with amount.

Returns: A PigmentStackIngredient that matches a given pigment tag with amount.
Return Type: PigmentStackIngredient

script.zs
PigmentStackIngredient.from(pigmentTag as MCTagWithAmount<Pigment>) as PigmentStackIngredient
ParameterTypeDescription
Parameter
pigmentTag
Type
MCTagWithAmount<Pigment>
Description
Tag and amount to match

Creates a PigmentStackIngredient that matches a given pigment and amount.

Returns: A PigmentStackIngredient that matches a given pigment and amount.
Return Type: PigmentStackIngredient

script.zs
PigmentStackIngredient.from(instance as Pigment, amount as long) as PigmentStackIngredient
ParameterTypeDescription
Parameter
instance
Type
Pigment
Description
Pigment to match
Parameter
amount
Type
long
Description
Amount needed

Creates a PigmentStackIngredient that matches a given pigment tag with a given amount.

Returns: A PigmentStackIngredient that matches a given pigment tag with a given amount.
Return Type: PigmentStackIngredient

script.zs
PigmentStackIngredient.from(pigmentTag as MCTag<Pigment>, amount as long) as PigmentStackIngredient
ParameterTypeDescription
Parameter
pigmentTag
Type
MCTag<Pigment>
Description
Tag to match
Parameter
amount
Type
long
Description
Amount needed

Casters

Result typeIs Implicit
Result type
IData
Is Implicit
true

Methods

Converts this PigmentStackIngredient into JSON (IData).

Returns: PigmentStackIngredient as JSON.
Return Type: IData

script.zs
// PigmentStackIngredient.asIData() as IData
myPigmentStackIngredient.asIData();

OR’s this PigmentStackIngredient with another PigmentStackIngredient to create a multi PigmentStackIngredient

Returns: Multi PigmentStackIngredient that matches both the source PigmentStackIngredient and the OR’d PigmentStackIngredient .
Return Type: PigmentStackIngredient

script.zs
PigmentStackIngredient.or(other as PigmentStackIngredient) as PigmentStackIngredient
ParameterTypeDescription
Parameter
other
Type
PigmentStackIngredient
Description
PigmentStackIngredient to combine with.

Operators

Returns a new GasStackIngredient using the two GasStackIngredient as a base.

script.zs
(ing1 as GasStackIngredient) | (ing2 as GasStackIngredient);