}
public static void HandleCraftingMaxtrix(InventoryCrafting CraftingMatrix, InventoryPlayer thePlayer)
{
for (int i=0; i<CraftingMatrix.getSizeInventory(); i++)
{
ItemStack CurStack = CraftingMatrix.getStackInSlot(i);
if (CurStack != null)
{
CraftingMatrix.decrStackSize(i, 1);
if(CurStack.getItem().hasContainerItem())
{
ItemStack item2 = new ItemStack(CurStack.getItem().getContainerItem());
CraftingMatrix.setInventorySlotContents(i, item2);
}
}
}
for(int i = 0; i <CraftingMatrix.getSizeInventory(); i++) {
ItemStack itemstack = CraftingMatrix.getStackInSlot(i);
if(itemstack != null) {
thePlayer.addItemStackToInventory(itemstack.copy());
CraftingMatrix.setInventorySlotContents(i, null);
}
}
}