Search in sources :

Example 1 with IAnvilRecipe

use of net.darkhax.bookshelf.crafting.IAnvilRecipe in project Bookshelf by Darkhax-Minecraft.

the class BookshelfEvents method onAnvilUpdate.

@SubscribeEvent
public void onAnvilUpdate(AnvilUpdateEvent event) {
    for (final IAnvilRecipe recipe : BookshelfRegistry.getAnvilRecipes()) {
        if (recipe.isValidRecipe(event.getLeft(), event.getRight(), event.getName())) {
            event.setCost(recipe.getExperienceCost(event.getLeft(), event.getRight(), event.getName()));
            event.setMaterialCost(recipe.getMaterialCost(event.getLeft(), event.getRight(), event.getName()));
            event.setOutput(recipe.getOutput(event.getLeft(), event.getRight(), event.getName()));
            return;
        }
    }
}
Also used : IAnvilRecipe(net.darkhax.bookshelf.crafting.IAnvilRecipe) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Aggregations

IAnvilRecipe (net.darkhax.bookshelf.crafting.IAnvilRecipe)1 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)1