Example usage for net.minecraftforge.common.brewing BrewingRecipe BrewingRecipe

List of usage examples for net.minecraftforge.common.brewing BrewingRecipe BrewingRecipe

Introduction

In this page you can find the example usage for net.minecraftforge.common.brewing BrewingRecipe BrewingRecipe.

Prototype

public BrewingRecipe(Ingredient input, Ingredient ingredient, ItemStack output) 

Source Link

Usage

From source file:com.lothrazar.cyclicmagic.registry.RecipeRegistry.java

License:Open Source License

/**
 * Currently not used but it does work.//from   www.  j  a v  a 2  s .c om
 * 
 * has built in unit test
 * 
 * @param input
 * @param ingredient
 * @param output
 * @return
 */
public static BrewingRecipe addBrewingRecipe(ItemStack input, ItemStack ingredient, ItemStack output) {
    if (input.isEmpty() || input.getItem() == null) {
        return null;
    }
    BrewingRecipe recipe = new BrewingRecipe(input, ingredient, output);
    BrewingRecipeRegistry.addRecipe(recipe);
    if (ModCyclic.logger.runUnitTests()) {//OMG UNIT TESTING WAAT
        ItemStack output0 = BrewingRecipeRegistry.getOutput(input, ingredient);
        if (output0.getItem() == output.getItem())
            ModCyclic.logger.logTestResult(
                    "Brewing Recipe succefully registered and working: " + output.getTranslationKey());
        else {
            ModCyclic.logger.logTestResult("Brewing Recipe FAILED to register" + output.getTranslationKey());
        }
    }
    return recipe;
}