Sawmill (Mekanism)
Description
Converts an input itemstack into an output itemstack, with an optional additional output.
Identifier
Refer to this via any of the following:
mods.mekanism.sawmill/* Used as page default */
mods.mekanism.Sawmill
Adding Recipes
Adds recipes in the format
ingredient
,output
,secondary
,chance
:groovymods.mekanism.sawmill.add(IIngredient, ItemStack, ItemStack, double)
Example
mods.mekanism.sawmill.add(item('minecraft:diamond_block'), item('minecraft:diamond') * 9, item('minecraft:clay_ball'), 0.7)
Recipe Builder
Just like other recipe types, the Sawmill also uses a recipe builder.
Don't know what a builder is? Check the builder info page out.
mods.mekanism.sawmill.recipeBuilder()
IngredientList<IIngredient>
. Sets the item inputs of the recipe. Requires exactly 1.groovyinput(IIngredient) input(IIngredient...) input(Collection<IIngredient>)
ItemStackList
. Sets the item outputs of the recipe. Requires exactly 1.groovyoutput(ItemStack) output(ItemStack...) output(Collection<ItemStack>)
ItemStack
. Sets the extra itemstack produced by the recipe. (DefaultItemStack.EMPTY
).groovyextra(ItemStack)
double
. Sets the chance the extra itemstack has to be produced. Requires greater than or equal to 0 and less than or equal to 1. (Default1.0
).groovychance(double)
First validates the builder, returning
null
and outputting errors to the log file if the validation failed, then registers the builder and returns the registered object. (returnsnull
ormekanism.common.recipe.machines.SawmillRecipe
).groovyregister()
Example
mods.mekanism.sawmill.recipeBuilder()
.input(item('minecraft:diamond_block'))
.output(item('minecraft:diamond') * 9)
.extra(item('minecraft:clay_ball'))
.register()
Removing Recipes
Adds recipes in the format
ingredient
,output
:groovymods.mekanism.sawmill.add(IIngredient, ItemStack)
Adds recipes in the format
ingredient
,output
,secondary
:groovymods.mekanism.sawmill.add(IIngredient, ItemStack, ItemStack)
Removes all recipes that match the given input:
groovymods.mekanism.sawmill.removeByInput(IIngredient)
Removes all registered recipes:
groovymods.mekanism.sawmill.removeAll()
Example
mods.mekanism.sawmill.removeByInput(item('minecraft:ladder'))
mods.mekanism.sawmill.removeAll()
Getting the value of recipes
Iterates through every entry in the registry, with the ability to call remove on any element to remove it:
groovymods.mekanism.sawmill.streamRecipes()