Skip to content

Energetic Infuser (Thermal Expansion) ​

Description ​

Converts an input itemstack into an output itemstack, costing power and taking time based on the power cost.

Identifier ​

The identifier mods.thermalexpansion.charger will be used as the default on this page.

All Identifiers

Any of these can be used to refer to this compat:

groovy
mods.thermal.charger
mods.thermal.Charger
mods.thermalexpansion.charger/* Used as page default */
mods.thermalexpansion.Charger

Adding Recipes ​

  • Adds recipes in the format energy, input, output:

    groovy
    mods.thermalexpansion.charger.add(int, IIngredient, ItemStack)
Example
groovy
mods.thermalexpansion.charger.add(1000, item('minecraft:obsidian'), item('minecraft:diamond') * 2)

Recipe Builder ​

Just like other recipe types, the Energetic Infuser also uses a recipe builder.

Don't know what a builder is? Check the builder info page out.

Recipe Builder
  • Create the Recipe Builder.

    groovy
    mods.thermalexpansion.charger.recipeBuilder()

  • IngredientList<IIngredient>. Sets the item inputs of the recipe. Requires exactly 1.

    groovy
    input(IIngredient)
    input(IIngredient...)
    input(Collection<IIngredient>)
  • ItemStackList. Sets the item outputs of the recipe. Requires exactly 1.

    groovy
    output(ItemStack)
    output(ItemStack...)
    output(Collection<ItemStack>)
  • int. Sets the energy cost of the recipe. Requires greater than 0. (Default ChargerManager.DEFAULT_ENERGY).

    groovy
    energy(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. (returns null or cofh.thermalexpansion.util.managers.machine.ChargerManager$ChargerRecipe).

    groovy
    register()

Example
groovy
mods.thermalexpansion.charger.recipeBuilder()
    .input(item('minecraft:diamond') * 5)
    .output(item('minecraft:clay'))
    .register()

mods.thermalexpansion.charger.recipeBuilder()
    .input(item('minecraft:clay'))
    .output(item('minecraft:diamond') * 2)
    .energy(1000)
    .register()

Removing Recipes ​

  • Removes all recipes that match the given input:

    groovy
    mods.thermalexpansion.charger.removeByInput(IIngredient)
  • Removes all recipes that match the given output:

    groovy
    mods.thermalexpansion.charger.removeByOutput(IIngredient)
  • Removes all registered recipes:

    groovy
    mods.thermalexpansion.charger.removeAll()
Example
groovy
mods.thermalexpansion.charger.removeByInput(item('thermalfoundation:bait:1'))
mods.thermalexpansion.charger.removeByOutput(item('thermalfoundation:fertilizer:2'))
mods.thermalexpansion.charger.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:

    groovy
    mods.thermalexpansion.charger.streamRecipes()

Contributors

© 2024 CleanroomMC. All Rights Reserved.