Skip to content

Magnet Centrifuge (Factory Tech)

Description

Converts an input itemstack into up to 3 output itemstacks, with the ability to control if stone parts are allowed.

Identifier

Refer to this via any of the following:

groovy
mods.factorytech.magnet_centrifuge/* Used as page default */
mods.factorytech.magnetcentrifuge
mods.factorytech.magnetCentrifuge
mods.factorytech.MagnetCentrifuge

Adding Recipes

  • Add the given recipe to the recipe list:

    groovy
    mods.factorytech.magnet_centrifuge.add(MachineRecipes.MachineRecipe<ItemStack, ItemStack[]>)

Recipe Builder

Just like other recipe types, the Magnet Centrifuge 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.factorytech.magnet_centrifuge.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 greater than or equal to 1 and less than or equal to 3.

    groovy
    output(ItemStack)
    output(ItemStack...)
    output(Collection<ItemStack>)
  • boolean. Sets if the recipe can use stone parts. (Default false).

    groovy
    allowStoneParts()
    allowStoneParts(boolean)

  • 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 dalapo.factech.auxiliary.MachineRecipes$MachineRecipe<net.minecraft.item.ItemStack, net.minecraft.item.ItemStack[]>).

    groovy
    register()

Example
groovy
mods.factorytech.magnet_centrifuge.recipeBuilder()
    .input(item('minecraft:clay'))
    .output(item('minecraft:obsidian'), item('minecraft:gold_ingot') * 2, item('minecraft:diamond'))
    .register()

mods.factorytech.magnet_centrifuge.recipeBuilder()
    .input(item('minecraft:gold_ingot'))
    .output(item('minecraft:clay'))
    .allowStoneParts()
    .register()

Removing Recipes

  • Removes the given recipe from the recipe list:

    groovy
    mods.factorytech.magnet_centrifuge.remove(MachineRecipes.MachineRecipe<ItemStack, ItemStack[]>)
  • Removes all recipes that match the given input:

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

    groovy
    mods.factorytech.magnet_centrifuge.removeByOutput(IIngredient)
  • Removes all registered recipes:

    groovy
    mods.factorytech.magnet_centrifuge.removeAll()
Example
groovy
mods.factorytech.magnet_centrifuge.removeByInput(item('minecraft:gravel'))
mods.factorytech.magnet_centrifuge.removeByOutput(item('minecraft:redstone'))
mods.factorytech.magnet_centrifuge.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.factorytech.magnet_centrifuge.streamRecipes()

Contributors

© 2024 CleanroomMC. All Rights Reserved.