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

GasStackIngredient

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.GasStackIngredient;

Implemented Interfaces

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

Static Methods

Combines multiple GasStackIngredient s into a single GasStackIngredient .

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

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

Creates a GasStackIngredient that matches a given gas tag with amount.

Returns: A GasStackIngredient that matches a given gas tag with amount.
Return Type: GasStackIngredient

script.zs
GasStackIngredient.from(gasTag as MCTagWithAmount<Gas>) as GasStackIngredient
ParameterTypeDescription
Parameter
gasTag
Type
MCTagWithAmount<Gas>
Description
Tag and amount to match

Creates a GasStackIngredient that matches a given gas stack.

Returns: A GasStackIngredient that matches a given gas stack.
Return Type: GasStackIngredient

script.zs
GasStackIngredient.from(instance as GasStack) as GasStackIngredient
ParameterTypeDescription
Parameter
instance
Type
GasStack
Description
Gas stack to match

Creates a GasStackIngredient that matches a given gas tag with a given amount.

Returns: A GasStackIngredient that matches a given gas tag with a given amount.
Return Type: GasStackIngredient

script.zs
GasStackIngredient.from(gasTag as MCTag<Gas>, amount as long) as GasStackIngredient
ParameterTypeDescription
Parameter
gasTag
Type
MCTag<Gas>
Description
Tag to match
Parameter
amount
Type
long
Description
Amount needed

Creates a GasStackIngredient that matches a given gas and amount.

Returns: A GasStackIngredient that matches a given gas and amount.
Return Type: GasStackIngredient

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

Casters

Result typeIs Implicit
Result type
IData
Is Implicit
true

Methods

Converts this GasStackIngredient into JSON (IData).

Returns: GasStackIngredient as JSON.
Return Type: IData

script.zs
// GasStackIngredient.asIData() as IData
myGasStackIngredient.asIData();

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

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

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

Operators

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

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