Skip to content

Stone Anvil (Primal Tech)

Description

Converts an input item into an output itemstack after being interacted with by a player using a Stone Mallet.

Identifier

Refer to this via any of the following:

groovy
mods.primal_tech.stone_anvil/* Used as page default */
mods.primal_tech.stoneanvil
mods.primal_tech.stoneAnvil
mods.primal_tech.StoneAnvil
mods.primaltech.stone_anvil
mods.primaltech.stoneanvil
mods.primaltech.stoneAnvil
mods.primaltech.StoneAnvil

Adding Recipes

  • Adds recipes in the format output, input:

    groovy
    mods.primal_tech.stone_anvil.add(ItemStack, IIngredient)

Recipe Builder

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

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

mods.primal_tech.stone_anvil.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 primal_tech.recipes.StoneAnvilRecipes).

    groovy
    register()
Example
groovy
mods.primal_tech.stone_anvil.recipeBuilder()
    .input(item('minecraft:diamond'))
    .output(item('minecraft:clay'))
    .register()

mods.primal_tech.stone_anvil.recipeBuilder()
    .input(item('minecraft:gold_ingot'))
    .output(item('minecraft:diamond') * 4)
    .register()

Removing Recipes

  • Removes all recipes that match the given input:

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

    groovy
    mods.primal_tech.stone_anvil.removeByOutput(IIngredient)
  • Removes all registered recipes:

    groovy
    mods.primal_tech.stone_anvil.removeAll()
Example
groovy
mods.primal_tech.stone_anvil.removeByInput(item('primal_tech:flint_block'))
mods.primal_tech.stone_anvil.removeByOutput(item('minecraft:flint'))
mods.primal_tech.stone_anvil.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.primal_tech.stone_anvil.streamRecipes()

Contributors

Changelog

© 2024 CleanroomMC. All Rights Reserved.