Skip to content

Generators (Extra Utilities 2)

Description

Converts up to two input itemstacks and an input fluidstack into energy over time.

Identifier

Refer to this via any of the following:

groovy
mods.extrautils2.generator/* Used as page default */
mods.extrautils2.Generator
mods.extrautilities2.generator
mods.extrautilities2.Generator

Adding Recipes

Recipe Builder

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

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

mods.extrautils2.generator.recipeBuilder()
  • IngredientList<IIngredient>. Sets the item inputs of the recipe. Requires greater than or equal to 0 and less than or equal to 2.

    groovy
    input(IIngredient)
    input(IIngredient...)
    input(Collection<IIngredient>)
  • FluidStackList. Sets the fluid inputs of the recipe. Requires greater than or equal to 0 and less than or equal to 1.

    groovy
    fluidInput(FluidStack)
    fluidInput(FluidStack...)
    fluidInput(Collection<FluidStack>)
  • int. Sets the total energy produced by the recipe. Requires greater than 0. (Default 0).

    groovy
    energy(int)
  • Machine. Sets the generator the recipe is added to. Some generators require different numbers of input itemstacks or fluidstacks. Requires not null.

    groovy
    generator(String)
    generator(Machine)
    generator(ResourceLocation)
  • int. Sets the energy produced per tick by the recipe. Requires greater than 0. (Default 0).

    groovy
    energyPerTick(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 com.rwtema.extrautils2.api.machine.IMachineRecipe).

    groovy
    register()
Example
groovy
mods.extrautils2.generator.recipeBuilder()
    .generator('extrautils2:generator_pink')
    .input(item('minecraft:clay'))
    .energy(1000)
    .energyPerTick(100)
    .register()

mods.extrautils2.generator.recipeBuilder()
    .generator('extrautils2:generator_slime')
    .input(item('minecraft:clay') * 3)
    .input(item('minecraft:gold_ingot'))
    .energy(1000000)
    .energyPerTick(100)
    .register()

mods.extrautils2.generator.recipeBuilder()
    .generator('extrautils2:generator_redstone')
    .input(item('minecraft:clay') * 3)
    .fluidInput(fluid('water') * 300)
    .energy(1000)
    .energyPerTick(100)
    .register()

mods.extrautils2.generator.recipeBuilder()
    .generator('extrautils2:generator_lava')
    .fluidInput(fluid('water') * 300)
    .energy(100)
    .energyPerTick(1000)
    .register()

Removing Recipes

  • Removes a Generator recipe in the format generator, fluidstack:

    groovy
    mods.extrautils2.generator.remove(Machine, FluidStack)
  • Removes a Generator recipe in the format generator, itemstack:

    groovy
    mods.extrautils2.generator.remove(Machine, ItemStack)
  • Removes a Generator recipe in the format generator, fluidstack:

    groovy
    mods.extrautils2.generator.remove(ResourceLocation, FluidStack)
  • Removes a Generator recipe in the format generator, itemstack:

    groovy
    mods.extrautils2.generator.remove(ResourceLocation, ItemStack)
  • Removes a Generator recipe in the format generator, fluidstack:

    groovy
    mods.extrautils2.generator.remove(String, FluidStack)
  • Removes a Generator recipe in the format generator, itemstack:

    groovy
    mods.extrautils2.generator.remove(String, ItemStack)
  • Removes all recipes with given generator:

    groovy
    mods.extrautils2.generator.removeByGenerator(Machine)
  • Removes all recipes with given generator:

    groovy
    mods.extrautils2.generator.removeByGenerator(ResourceLocation)
  • Removes all recipes with given generator:

    groovy
    mods.extrautils2.generator.removeByGenerator(String)
  • Removes all registered recipes:

    groovy
    mods.extrautils2.generator.removeAll()
Example
groovy
mods.extrautils2.generator.remove('extrautils2:generator_lava', fluid('lava'))
mods.extrautils2.generator.remove('extrautils2:generator_culinary', item('minecraft:apple'))
mods.extrautils2.generator.removeByGenerator('extrautils2:generator_death')
mods.extrautils2.generator.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.extrautils2.generator.streamRecipes()

Contributors

© 2024 CleanroomMC. All Rights Reserved.

Layout Switch

Adjust the layout style of VitePress to adapt to different reading needs and screens.

Expand all
The sidebar and content area occupy the entire width of the screen.
Expand sidebar with adjustable values
Expand sidebar width and add a new slider for user to choose and customize their desired width of the maximum width of sidebar can go, but the content area width will remain the same.
Expand all with adjustable values
Expand sidebar width and add a new slider for user to choose and customize their desired width of the maximum width of sidebar can go, but the content area width will remain the same.
Original width
The original layout width of VitePress

Page Layout Max Width

Adjust the exact value of the page width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the page layout
A ranged slider for user to choose and customize their desired width of the maximum width of the page layout can go.

Content Layout Max Width

Adjust the exact value of the document content width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the content layout
A ranged slider for user to choose and customize their desired width of the maximum width of the content layout can go.

Spotlight

Highlight the line where the mouse is currently hovering in the content to optimize for users who may have reading and focusing difficulties.

ONOn
Turn on Spotlight.
OFFOff
Turn off Spotlight.

Spotlight Styles

Adjust the styles of Spotlight.

Under
Add a solid background color underneath the hovering element to highlight where the cursor is currently hovering.
Aside
Add a fixed line with solid color aside the hovering element to highlight where the cursor is currently hovering.