Anvil (Pyrotech)
Description
When using hammer or pickaxe it can convert items.
Identifier
Refer to this via any of the following:
mods.pyrotech.anvil/* Used as page default */
mods.pyrotech.Anvil
Adding Recipes
Adds recipes in the format
name
,input
,output
,hits
,tier
,type
:groovymods.pyrotech.anvil.add(String, IIngredient, ItemStack, int, String, String)
Example
mods.pyrotech.anvil.add('iron_to_clay', ore('ingotIron'), item('minecraft:clay_ball'), 9, 'granite', 'hammer')
Recipe Builder
Just like other recipe types, the Anvil also uses a recipe builder.
Don't know what a builder is? Check the builder info page out.
mods.pyrotech.anvil.recipeBuilder()
ResourceLocation
. Sets the Resource Location of the recipe.groovyname(String) name(ResourceLocation)
IngredientList<IIngredient>
. Sets the item inputs of the recipe. Requires exactly 1.groovyinput(IIngredient) input(IIngredient...) input(Collection<IIngredient>)
ItemStackList
. Sets the item outputs of the recipe. Requires exactly 1.groovyoutput(ItemStack) output(ItemStack...) output(Collection<ItemStack>)
int
. Sets how often the item needs to be hit. Requires greater than 0. (Default0
).groovyhits(int)
AnvilRecipe.EnumTier
. Sets the tier of the required anvil (Granite, Ironclad, Obsidian).groovytier(AnvilRecipe.EnumTier) tierGranite() tierIronclad() tierObsidian()
AnvilRecipe.EnumType
. Sets the type of tool required (Hammer, Pickaxe).groovytype(AnvilRecipe.EnumType) typeHammer() typePickaxe()
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. (returnsnull
orcom.codetaylor.mc.pyrotech.modules.tech.basic.recipe.AnvilRecipe
).groovyregister()
Example
mods.pyrotech.anvil.recipeBuilder()
.input(item('minecraft:diamond') * 4)
.output(item('minecraft:emerald') * 2)
.hits(5)
.typeHammer()
.tierGranite()
.name('diamond_to_emerald_granite_anvil')
.register()
mods.pyrotech.anvil.recipeBuilder()
.input(item('minecraft:diamond') * 8)
.output(item('minecraft:nether_star') * 1)
.hits(10)
.typePickaxe()
.tierIronclad()
.name('diamond_to_nether_star_ironclad_anvil')
.register()
mods.pyrotech.anvil.recipeBuilder()
.input(item('minecraft:diamond') * 4)
.output(item('minecraft:gold_ingot') * 16)
.hits(5)
.typePickaxe()
.tierObsidian()
.name('diamond_to_gold_obsidian_anvil')
.register()
Removing Recipes
Removes all recipes that match the given output:
groovymods.pyrotech.anvil.removeByOutput(ItemStack)
Removes all registered recipes:
groovymods.pyrotech.anvil.removeAll()
Example
mods.pyrotech.anvil.removeByOutput(item('minecraft:stone_slab', 3))
mods.pyrotech.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:
groovymods.pyrotech.anvil.streamRecipes()