//onCraftMatrixChanged(recipeOutputStack);
}
private void onCraftMatrixChanged(ItemStack recipeOutputStack)
{
InventoryPlayer inventoryPlayer = thePlayer.inventory;
// Call custom hooks.
ModLoader.takenFromCrafting(thePlayer, recipeOutputStack, craftMatrix);
ForgeHooks.onTakenFromCrafting(thePlayer, recipeOutputStack, craftMatrix);
// Remove items from the craftMatrix and replace container items.
for(int i = 0; i < craftMatrix.getSizeInventory(); i++)
{
ItemStack itemstack1 = craftMatrix.getStackInSlot(i);
if(itemstack1 != null)
{
craftMatrix.decrStackSize(i, 1);
if(itemstack1.getItem().hasContainerItem())
{
craftMatrix.setInventorySlotContents(i, new ItemStack(itemstack1.getItem().getContainerItem()));
}
}
}
// Transfer any remaining items in the craft matrix to the player.
for(int i = 0; i < craftMatrix.getSizeInventory(); i++) {
ItemStack itemstack = craftMatrix.getStackInSlot(i);
if(itemstack != null) {
inventoryPlayer.addItemStackToInventory(itemstack);
craftMatrix.setInventorySlotContents(i, null);
}
}
}