Skip to content

Crusher (Mekanism)

Description

Converts an input itemstack into an output itemstack.

Identifier

Refer to this via any of the following:

groovy
mods.mekanism.crusher/* Used as page default */
mods.mekanism.Crusher

Adding Recipes

  • Adds recipes in the format ingredient, output:

    groovy
    mods.mekanism.crusher.add(IIngredient, ItemStack)
Example
groovy
mods.mekanism.crusher.add(item('minecraft:clay_ball'), item('minecraft:gold_ingot'))

Recipe Builder

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

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

mods.mekanism.crusher.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>)
  • 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 mekanism.common.recipe.machines.CrusherRecipe).

    groovy
    register()
Example
groovy
mods.mekanism.crusher.recipeBuilder()
    .input(item('minecraft:clay_ball'))
    .output(item('minecraft:gold_ingot'))
    .register()

Removing Recipes

  • Removes all recipes that match the given input:

    groovy
    mods.mekanism.crusher.removeByInput(IIngredient)
  • Removes all registered recipes:

    groovy
    mods.mekanism.crusher.removeAll()
Example
groovy
mods.mekanism.crusher.removeByInput(ore('ingotTin'))
mods.mekanism.crusher.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.mekanism.crusher.streamRecipes()

© 2024 CleanroomMC. All Rights Reserved.