// Path: src/main/java/brightspark/sparkshammers/hammerCrafting/HammerCraftingManager.java
// public class HammerCraftingManager
// {
//     public static IForgeRegistry<HammerShapedOreRecipe> REGISTRY;
// 
//     /**
//      * Returns the static instance of this class
//      */
//     public static void setRegistry(IForgeRegistry<HammerShapedOreRecipe> registry)
//     {
//         REGISTRY = registry;
//     }
// 
//     public static List<HammerShapedOreRecipe> getRecipes()
//     {
//         return REGISTRY.getValues();
//     }
// 
//     private HammerCraftingManager() {}
// 
//     public static ItemStack findMatchingRecipe(InventoryCrafting invCrafting)
//     {
//         for(HammerShapedOreRecipe recipe : REGISTRY)
//             if(recipe.matches(invCrafting))
//                 return recipe.getRecipeOutput();
// 
//         return ItemStack.EMPTY;
//     }
// 
//     public static NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv)
//     {
//         for (HammerShapedOreRecipe recipe : REGISTRY)
//             if (recipe.matches(inv))
//                 return recipe.getRemainingItems(inv);
//         return ForgeHooks.defaultRecipeGetRemainingItems(inv);
//     }
// 
//     /**
//      * Returns the list of all valid recipes which do not have any missing ingredients
//      * This is used by the JEI plugin
//      */
//     public static List<HammerShapedOreRecipe> getValidRecipeList()
//     {
//         List<HammerShapedOreRecipe> validRecipes = Lists.newArrayList();
//         for(HammerShapedOreRecipe recipe : REGISTRY)
//         {
//             String oreDic = ((ItemAOE) recipe.getRecipeOutput().getItem()).getDependantOreDic();
//             if(oreDic == null || !OreDictionary.getOres(oreDic).isEmpty())
//                 validRecipes.add(recipe);
//         }
//         return validRecipes;
//     }
// }


import brightspark.sparkshammers.hammerCrafting.HammerCraftingManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.inventory.SlotCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;
package brightspark.sparkshammers.gui;


public class SlotSHCrafting extends SlotCrafting
{
    private InventoryCrafting craftMatrix;

    public SlotSHCrafting(EntityPlayer player, InventoryCrafting craftingInventory, IInventory inventoryIn, int slotIndex, int xPosition, int yPosition)
    {
        super(player, craftingInventory, inventoryIn, slotIndex, xPosition, yPosition);
        this.craftMatrix = craftingInventory;
    }

    /**
     * Similar to the SlotCrafting implementation, but using HammerCraftingManager.getRemainingItems
     */
    @Override
    public ItemStack onTake(EntityPlayer player, ItemStack stack)
    {
        onCrafting(stack);
// Path: src/main/java/brightspark/sparkshammers/hammerCrafting/HammerCraftingManager.java
// public class HammerCraftingManager
// {
//     public static IForgeRegistry<HammerShapedOreRecipe> REGISTRY;
// 
//     /**
//      * Returns the static instance of this class
//      */
//     public static void setRegistry(IForgeRegistry<HammerShapedOreRecipe> registry)
//     {
//         REGISTRY = registry;
//     }
// 
//     public static List<HammerShapedOreRecipe> getRecipes()
//     {
//         return REGISTRY.getValues();
//     }
// 
//     private HammerCraftingManager() {}
// 
//     public static ItemStack findMatchingRecipe(InventoryCrafting invCrafting)
//     {
//         for(HammerShapedOreRecipe recipe : REGISTRY)
//             if(recipe.matches(invCrafting))
//                 return recipe.getRecipeOutput();
// 
//         return ItemStack.EMPTY;
//     }
// 
//     public static NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv)
//     {
//         for (HammerShapedOreRecipe recipe : REGISTRY)
//             if (recipe.matches(inv))
//                 return recipe.getRemainingItems(inv);
//         return ForgeHooks.defaultRecipeGetRemainingItems(inv);
//     }
// 
//     /**
//      * Returns the list of all valid recipes which do not have any missing ingredients
//      * This is used by the JEI plugin
//      */
//     public static List<HammerShapedOreRecipe> getValidRecipeList()
//     {
//         List<HammerShapedOreRecipe> validRecipes = Lists.newArrayList();
//         for(HammerShapedOreRecipe recipe : REGISTRY)
//         {
//             String oreDic = ((ItemAOE) recipe.getRecipeOutput().getItem()).getDependantOreDic();
//             if(oreDic == null || !OreDictionary.getOres(oreDic).isEmpty())
//                 validRecipes.add(recipe);
//         }
//         return validRecipes;
//     }
// }


// Path: src/main/java/brightspark/sparkshammers/gui/SlotSHCrafting.java
import brightspark.sparkshammers.hammerCrafting.HammerCraftingManager;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.inventory.SlotCrafting;
import net.minecraft.item.ItemStack;
import net.minecraft.util.NonNullList;

package brightspark.sparkshammers.gui;


public class SlotSHCrafting extends SlotCrafting
{
    private InventoryCrafting craftMatrix;

    public SlotSHCrafting(EntityPlayer player, InventoryCrafting craftingInventory, IInventory inventoryIn, int slotIndex, int xPosition, int yPosition)
    {
        super(player, craftingInventory, inventoryIn, slotIndex, xPosition, yPosition);
        this.craftMatrix = craftingInventory;
    }

    /**
     * Similar to the SlotCrafting implementation, but using HammerCraftingManager.getRemainingItems
     */
    @Override
    public ItemStack onTake(EntityPlayer player, ItemStack stack)
    {
        onCrafting(stack);
        NonNullList<ItemStack> remaining = HammerCraftingManager.getRemainingItems(craftMatrix);