Skip to content

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

The identifier mods.thermalexpansion.compactor 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.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:

    groovy
    mods.thermalexpansion.compactor.add(int, CompactorManager.Mode, IIngredient, ItemStack)
Example
groovy
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.

Recipe Builder
  • Create the Recipe Builder.

    groovy
    mods.thermalexpansion.compactor.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>)
  • CompactorManager.Mode. Sets the mode of the recipe, controlling what augments are allowed, if any, for the recipe to operate. (Default CompactorManager.Mode.ALL).

    groovy
    mode(CompactorManager.Mode)
  • int. Sets the energy cost of the recipe. Requires greater than 0. (Default CompactorManager.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.CompactorManager$CompactorRecipe).

    groovy
    register()

Example
groovy
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 all recipes for the given mode:

    groovy
    mods.thermalexpansion.compactor.removeByMode(CompactorManager.Mode)
  • Removes the given IIngredient input from the given Compactor mode:

    groovy
    mods.thermalexpansion.compactor.removeByInput(IIngredient)
  • Removes the given IIngredient input from the given Compactor mode:

    groovy
    mods.thermalexpansion.compactor.removeByInput(CompactorManager.Mode, IIngredient)
  • Removes the given IIngredient output from the given Compactor mode:

    groovy
    mods.thermalexpansion.compactor.removeByOutput(IIngredient)
  • Removes the given IIngredient output from the given Compactor mode:

    groovy
    mods.thermalexpansion.compactor.removeByOutput(CompactorManager.Mode, IIngredient)
  • Removes all registered recipes:

    groovy
    mods.thermalexpansion.compactor.removeAll()
Example
groovy
mods.thermalexpansion.compactor.removeByMode(compactorMode('plate'))
mods.thermalexpansion.compactor.removeByInput(item('minecraft:iron_ingot'))
mods.thermalexpansion.compactor.removeByInput(compactorMode('coin'), item('thermalfoundation:material:130'))
mods.thermalexpansion.compactor.removeByOutput(item('thermalfoundation:material:24'))
mods.thermalexpansion.compactor.removeByOutput(item('minecraft:blaze_rod'))
mods.thermalexpansion.compactor.removeByOutput(compactorMode('coin'), item('thermalfoundation:coin:102'))
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:

    groovy
    mods.thermalexpansion.compactor.streamRecipes()

Contributors

© 2024 CleanroomMC. All Rights Reserved.