MinecraftForge/MinecraftForge — pull request #987 by DemoXinMC (2014-03-01 22:05:52+00:00)
Title: * IAnvilRecipe (IRecipe-style Anvil Recipes)

Currently, outside of specifying repair materials, there is no way to create recipes for use in anvils. This allows for that creation, as well as allowing modders to specify separate visual (displayed in the anvil GUI) and actual (the item pulled from the anvil upon "repairing") results.

Modders can specify level cost and output, with the getOutput() method allowing IAnvilRecipe's to modify all ItemStacks in the anvil to be edited when the "repair" is completed to create the final output.

Adding a repair handler: AnvilRecipes.addRepair(IAnvilRecipe myHandler);

IAnvilRecipe.matches: Returns a boolean true if the given ItemStacks are able to be handled using this handler.
IAnvilRecipe.getResult: Returns an ItemStack that will be displayed in the anvil GUI.
IAnvilRecipe.getCost: Returns an int that corresponds to the experience levels required for the repair
IAnvilRecipe.getOutput: Exposes all 3 ItemStacks to be altered when the repair is completed (player removes the result from the output slot.