Example usage for net.minecraftforge.event AnvilUpdateEvent AnvilUpdateEvent

List of usage examples for net.minecraftforge.event AnvilUpdateEvent AnvilUpdateEvent

Introduction

In this page you can find the example usage for net.minecraftforge.event AnvilUpdateEvent AnvilUpdateEvent.

Prototype

public AnvilUpdateEvent(@Nonnull ItemStack left, @Nonnull ItemStack right, String name, int cost) 

Source Link

Usage

From source file:com.smithsmodding.armory.api.crafting.blacksmiths.recipe.VanillaAnvilRecipe.java

private boolean checkForge(ItemStack pLeftStack, ItemStack pRightStack, String pName, int pBaseCost) {
    AnvilUpdateEvent e = new AnvilUpdateEvent(pLeftStack, pRightStack, pName, pBaseCost);
    if (MinecraftForge.EVENT_BUS.post(e))
        return false;
    if (e.getOutput() == null)
        return true;

    this.iOutputStack = e.getOutput();
    this.iMaximumCost = e.getCost();
    this.iStackSizeToBeUsedInRepair = e.getMaterialCost();
    return false;
}