Home Commands Examples Getting Started With Scripts Global Keywords
Generic JSON Recipes

Refinery

Allows you to add or remove Refinery recipes.

Refinery Recipes consist of two fluid inputs and a fluid output.

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.immersiveengineering.Refinery;

Implemented Interfaces

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

Methods

script.zs
Refinery.addJsonRecipe(name as string, mapData as MapData)
ParameterType
Parameter
name
Type
string
Parameter
mapData
Type
MapData

Adds a recipe to the Refinery. Make sure that the provided Tags are valid fluid tags.

script.zs
Refinery.addRecipe(recipePath as string, fluidInput1 as Many<MCTag>, fluidInput2 as Many<MCTag>, catalyst as IIngredient, energy as int, output as IFluidStack)
ParameterTypeDescription
Parameter
recipePath
Type
string
Description
The recipe name, without the resource location
Parameter
fluidInput1
Type
Many<MCTag>
Description
The first fluid input, as Tag
Parameter
fluidInput2
Type
Many<MCTag>
Description
The second fluid input, as Tag
Parameter
catalyst
Type
IIngredient
Description
The catalyst of the recipe
Parameter
energy
Type
int
Description
The total energy required
Parameter
output
Type
IFluidStack
Description
The output fluid

Return Type: stdlib.List<T>

script.zs
// Refinery.getAllRecipes() as stdlib.List<T>
<recipetype:immersiveengineering:refinery>.getAllRecipes();

Return Type: T

script.zs
Refinery.getRecipeByName(name as string) as T
ParameterType
Parameter
name
Type
string

Return Type: T[ResourceLocation]

script.zs
// Refinery.getRecipeMap() as T[ResourceLocation]
<recipetype:immersiveengineering:refinery>.getRecipeMap();

Return Type: stdlib.List<T>

script.zs
Refinery.getRecipesByOutput(output as IIngredient) as stdlib.List<T>
ParameterType
Parameter
output
Type
IIngredient
script.zs
// Refinery.removeAll()
<recipetype:immersiveengineering:refinery>.removeAll();
script.zs
Refinery.removeByInput(input as IItemStack)
ParameterType
Parameter
input
Type
IItemStack
script.zs
Refinery.removeByModid(modid as string, exclude as Predicate<string>)
ParameterTypeOptionalDefault Value
Parameter
modid
Type
string
Optional
false
Default Value
Parameter
exclude
Type
Predicate<string>
Optional
true
Default Value
(name as string) as bool => false
script.zs
Refinery.removeByName(names as string[])
ParameterType
Parameter
names
Type
string[]
script.zs
Refinery.removeByRegex(regex as string, exclude as Predicate<string>)
ParameterTypeOptionalDefault Value
Parameter
regex
Type
string
Optional
false
Default Value
Parameter
exclude
Type
Predicate<string>
Optional
true
Default Value
(name as string) as bool => false

Removes all recipes that return this given fluid. Since it’s only the fluid, it does not check amounts.

script.zs
// Refinery.removeRecipe(fluid as Fluid)
<recipetype:immersiveengineering:refinery>.removeRecipe(<fluid:immersiveengineering:biodiesel>.fluid);
ParameterTypeDescription
Parameter
fluid
Type
Fluid
Description
The fluid output to remove

Removes all recipes that return this given fluid Stack. Only removes if the fluid and the fluid amount match.

script.zs
// Refinery.removeRecipe(fluidStack as IFluidStack)
<recipetype:immersiveengineering:refinery>.removeRecipe(<fluid:immersiveengineering:biodiesel> * 16);
ParameterTypeDescription
Parameter
fluidStack
Type
IFluidStack
Description
The output to remove

Properties

NameTypeHas GetterHas Setter
Name
allRecipes
Type
stdlib.List<T>
Has Getter
true
Has Setter
false
Name
recipeMap
Type
T[ResourceLocation]
Has Getter
true
Has Setter
false