Compactor (Thermal Expansion)
Description
Converts an input itemstack into an output itemstack, with different modes each requiring a different augment to be installed, costing power and taking time based on the power cost.
Identifier
Refer to this via any of the following:
mods.thermal.compactor
mods.thermal.Compactor
mods.thermalexpansion.compactor/* Used as page default */
mods.thermalexpansion.Compactor
Adding Recipes
Adds recipes in the format
energy
,mode
,input
,output
:groovymods.thermalexpansion.compactor.add(int, CompactorManager.Mode, IIngredient, ItemStack)
Example
mods.thermalexpansion.compactor.add(1000, compactorMode('plate'), item('minecraft:obsidian') * 2, item('minecraft:gold_ingot'))
Recipe Builder
Just like other recipe types, the Compactor also uses a recipe builder.
Don't know what a builder is? Check the builder info page out.
mods.thermalexpansion.compactor.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>)
CompactorManager.Mode
. Sets the mode of the recipe, controlling what augments are allowed, if any, for the recipe to operate. (DefaultCompactorManager.Mode.ALL
).groovymode(CompactorManager.Mode)
int
. Sets the energy cost of the recipe. Requires greater than 0. (DefaultCompactorManager.DEFAULT_ENERGY
).groovyenergy(int)
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.machine.CompactorManager$CompactorRecipe
).groovyregister()
Example
mods.thermalexpansion.compactor.recipeBuilder()
.input(item('minecraft:clay'))
.output(item('minecraft:diamond') * 2)
.mode(compactorMode('coin'))
.register()
mods.thermalexpansion.compactor.recipeBuilder()
.input(item('minecraft:clay'))
.output(item('minecraft:diamond'))
.mode(compactorMode('all'))
.register()
mods.thermalexpansion.compactor.recipeBuilder()
.input(item('minecraft:diamond') * 2)
.output(item('minecraft:gold_ingot'))
.mode(compactorMode('plate'))
.energy(1000)
.register()
Removing Recipes
Removes the given IIngredient input from the given Compactor mode:
groovymods.thermalexpansion.compactor.removeByInput(CompactorManager.Mode, IIngredient)
Removes the given IIngredient input from the given Compactor mode:
groovymods.thermalexpansion.compactor.removeByInput(IIngredient)
Removes all recipes for the given mode:
groovymods.thermalexpansion.compactor.removeByMode(CompactorManager.Mode)
Removes the given IIngredient output from the given Compactor mode:
groovymods.thermalexpansion.compactor.removeByOutput(CompactorManager.Mode, IIngredient)
Removes the given IIngredient output from the given Compactor mode:
groovymods.thermalexpansion.compactor.removeByOutput(IIngredient)
Removes all registered recipes:
groovymods.thermalexpansion.compactor.removeAll()
Example
mods.thermalexpansion.compactor.removeByInput(compactorMode('coin'), item('thermalfoundation:material:130'))
mods.thermalexpansion.compactor.removeByInput(item('minecraft:iron_ingot'))
mods.thermalexpansion.compactor.removeByMode(compactorMode('plate'))
mods.thermalexpansion.compactor.removeByOutput(compactorMode('coin'), item('thermalfoundation:coin:102'))
mods.thermalexpansion.compactor.removeByOutput(item('thermalfoundation:material:24'))
mods.thermalexpansion.compactor.removeByOutput(item('minecraft:blaze_rod'))
mods.thermalexpansion.compactor.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.compactor.streamRecipes()