}
// 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);
}
}
}