Skip to content

Distillation Tower (Immersive Petroleum)

Description

Converts an input fluidstack into any number of output fluidstacks and any number of output itemstacks, with each itemstack having the ability to have a custom chance, using energy and taking time.

Identifier

Refer to this via any of the following:

groovy
mods.immersivepetroleum.distillation/* Used as page default */
mods.immersivepetroleum.Distillation

Adding Recipes

Recipe Builder

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

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

mods.immersivepetroleum.distillation.recipeBuilder()
  • FluidStackList. Sets the fluid inputs of the recipe. Requires exactly 1.

    groovy
    fluidInput(FluidStack)
    fluidInput(FluidStack...)
    fluidInput(Collection<FluidStack>)
  • ItemStackList. Sets the item outputs of the recipe. Requires greater than or equal to 0 and less than or equal to Integer.MAX_VALUE.

    groovy
    output(ItemStack)
    output(ItemStack...)
    output(ItemStack, float)
    output(Collection<ItemStack>)
  • FluidStackList. Sets the fluid outputs of the recipe. Requires greater than or equal to 0 and less than or equal to Integer.MAX_VALUE.

    groovy
    fluidOutput(FluidStack)
    fluidOutput(FluidStack...)
    fluidOutput(Collection<FluidStack>)
  • int. Sets the duration in ticks the recipe takes. Requires greater than or equal to 0. (Default 0).

    groovy
    time(int)
  • FloatArrayList. Sets the chance the corresponding entry in output will be output. Requires greater than or equal to 0.

    groovy
    output(ItemStack)
    output(ItemStack, float)
  • int. Sets the energy cost of the recipe. Requires greater than or equal to 0. (Default 0).

    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 flaxbeard.immersivepetroleum.api.crafting.DistillationRecipe).

    groovy
    register()
Example
groovy
mods.immersivepetroleum.distillation.recipeBuilder()
    .fluidInput(fluid('water') * 100)
    .fluidOutput(fluid('water') * 50, fluid('lava') * 30)
    .output(item('minecraft:diamond'), 0.5)
    .output(item('minecraft:clay'), 0.2)
    .output(item('minecraft:diamond'), 0.1)
    .output(item('minecraft:clay'), 0.5)
    .output(item('minecraft:diamond') * 5, 0.01)
    .time(5)
    .energy(1000)
    .register()

mods.immersivepetroleum.distillation.recipeBuilder()
    .fluidInput(fluid('lava') * 5)
    .output(item('minecraft:diamond'))
    .time(1)
    .register()

Removing Recipes

  • Removes all recipes that match the given input:

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

    groovy
    mods.immersivepetroleum.distillation.removeByOutput(IIngredient)
  • Removes all registered recipes:

    groovy
    mods.immersivepetroleum.distillation.removeAll()
Example
groovy
mods.immersivepetroleum.distillation.removeByInput(fluid('oil'))
mods.immersivepetroleum.distillation.removeByOutput(item('immersivepetroleum:material'))
mods.immersivepetroleum.distillation.removeByOutput(fluid('lubricant'))
mods.immersivepetroleum.distillation.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.immersivepetroleum.distillation.streamRecipes()

Contributors

Changelog

© 2024 CleanroomMC. All Rights Reserved.