Factorizer (Thermal Expansion)
Description
Converts an input itemstack into an output itemstack, with the ability to undo the the recipe. Mainly used for compressing ingots into blocks and splitting blocks into ingots.
Identifier
Refer to this via any of the following:
mods.thermal.factorizer
mods.thermal.Factorizer
mods.thermalexpansion.factorizer/* Used as page default */
mods.thermalexpansion.Factorizer
Adding Recipes
Adds recipes in the format
combine
,split
,input
,output
:groovymods.thermalexpansion.factorizer.add(boolean, boolean, IIngredient, ItemStack)
Recipe Builder
Just like other recipe types, the Factorizer also uses a recipe builder.
Don't know what a builder is? Check the builder info page out.
mods.thermalexpansion.factorizer.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>)
boolean
. Sets the recipe to have an inverted version (input is output, output is input) in the split mode. (Defaultfalse
).groovysplit() split(boolean)
boolean
. Sets the recipe to have a version in the combine mode. (Defaultfalse
).groovycombine() combine(boolean)
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
orcofh.thermalexpansion.util.managers.device.FactorizerManager$FactorizerRecipe
).groovyregister()
Example
mods.thermalexpansion.factorizer.recipeBuilder()
.input(item('minecraft:clay') * 7)
.output(item('minecraft:book') * 2)
.combine()
.split()
.register()
mods.thermalexpansion.factorizer.recipeBuilder()
.input(item('minecraft:planks:*') * 4)
.output(item('minecraft:crafting_table'))
.combine()
.register()
Removing Recipes
Removes all recipes with the given IIngredient input for the given mode, with
true
indicating split recipes andfalse
indicating combine recipes:groovymods.thermalexpansion.factorizer.removeByInput(boolean, IIngredient)
Removes all recipes with the given IIngredient input for the given mode, with
true
indicating split recipes andfalse
indicating combine recipes:groovymods.thermalexpansion.factorizer.removeByInput(IIngredient)
Removes all recipes with the given IIngredient output for the given mode, with
true
indicating split recipes andfalse
indicating combine recipes:groovymods.thermalexpansion.factorizer.removeByOutput(boolean, IIngredient)
Removes all recipes that match the given output:
groovymods.thermalexpansion.factorizer.removeByOutput(IIngredient)
Removes all recipes in the given mode, with
true
indicating split recipes, andfalse
indicating combine recipes:groovymods.thermalexpansion.factorizer.removeByType(boolean)
Removes all registered recipes:
groovymods.thermalexpansion.factorizer.removeAll()
Example
mods.thermalexpansion.factorizer.removeByInput(false, item('minecraft:diamond'))
mods.thermalexpansion.factorizer.removeByInput(item('minecraft:coal:1'))
mods.thermalexpansion.factorizer.removeByOutput(false, item('minecraft:coal:1'))
mods.thermalexpansion.factorizer.removeByOutput(item('minecraft:emerald_block'))
mods.thermalexpansion.factorizer.removeByType(true)
mods.thermalexpansion.factorizer.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.thermalexpansion.factorizer.streamRecipes()