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

Sawmill

Allows you to add or remove Sawmill recipes.

Sawmill Recipes consist of an input, an optional, intermediate “stripped” output and a “cut” output.

Each step (stripping and sawing) have possible secondary outputs. These won’t be returned through the conveyor belt, but through the item output to the front, right next to the sawblade.

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

Implemented Interfaces

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

Methods

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

Adds a sawmill recipe. This method is a shorter version for recipes that do not require stripping. Note that recipes without an intermediate item will do nothing if the sawmill has no sawblade.

script.zs
// Sawmill.addRecipe(recipePath as string, input as IIngredient, energy as int, output as IItemStack, outputSecondaries as IItemStack[])
<recipetype:immersiveengineering:sawmill>.addRecipe("splitting_bones", <item:minecraft:bone_block>, 1000, <item:minecraft:bone> * 5, [<item:minecraft:bone_meal> * 2]);
ParameterTypeDescription
Parameter
recipePath
Type
string
Description
The recipe name, without the resource location
Parameter
input
Type
IIngredient
Description
The item input
Parameter
energy
Type
int
Description
The total energy required
Parameter
output
Type
IItemStack
Description
The item that is returned
Parameter
outputSecondaries
Type
IItemStack[]
Description
The secondary outputs that are created alongside the output item

Adds a sawmill recipe.

Note that the recipe only works from start to final output.
So if you remove the sawblade to get the intermediate item, you need a 2nd recipe starting from the intermediate item if you later want to process that item.

script.zs
// Sawmill.addRecipe(recipePath as string, input as IIngredient, energy as int, strippedOutput as IItemStack, strippedOutputSecondaries as IItemStack[], output as IItemStack, outputSecondaries as IItemStack[])
<recipetype:immersiveengineering:sawmill>.addRecipe("shredding_seeds", <tag:minecraft:saplings>, 1200, <item:minecraft:dead_bush>, [<item:minecraft:grass>], <item:minecraft:stick> * 2, [<item:immersiveengineering:dust_wood>]);
ParameterTypeDescription
Parameter
recipePath
Type
string
Description
The recipe name, without the resource location
Parameter
input
Type
IIngredient
Description
The item input
Parameter
energy
Type
int
Description
The total energy required
Parameter
strippedOutput
Type
IItemStack
Description
The intermediate Stripped output. Will be returned if no sawblade is present
Parameter
strippedOutputSecondaries
Type
IItemStack[]
Description
The secondary outputs that are created while stripping. Must be empty if no intermediate output was provided.
Parameter
output
Type
IItemStack
Description
The output that is returned when a sawblade is present
Parameter
outputSecondaries
Type
IItemStack[]
Description
The secondary outputs that are created alongside the output item

Return Type: stdlib.List<T>

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

Return Type: T

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

Return Type: T[ResourceLocation]

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

Return Type: stdlib.List<T>

script.zs
Sawmill.getRecipesByOutput(output as IIngredient) as stdlib.List<T>
ParameterType
Parameter
output
Type
IIngredient
script.zs
// Sawmill.removeAll()
<recipetype:immersiveengineering:sawmill>.removeAll();
script.zs
Sawmill.removeByInput(input as IItemStack)
ParameterType
Parameter
input
Type
IItemStack
script.zs
Sawmill.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
Sawmill.removeByName(names as string[])
ParameterType
Parameter
names
Type
string[]
script.zs
Sawmill.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

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