@Override
 public ItemStack transferStackInSlot(EntityPlayer player, int slotNumber) {
   ItemStack stack = null;
   Slot slot = (Slot) inventorySlots.get(slotNumber);
   if (slot != null && slot.getHasStack()) {
     ItemStack slotClicked = slot.getStack();
     stack = slotClicked.copy();
     if (slotNumber <= 36) {
       if (slotNumber == 0 && stack != null && stack.stackSize > 0) {
         tile.decrementCraftingField();
       }
       if (!mergeItemStack(slotClicked, 37, inventorySlots.size(), true)) {
         return null;
       }
     } else {
       stack = null;
     }
     if (slotClicked.stackSize == 0) {
       slot.putStack(null);
     } else {
       slot.onSlotChanged();
     }
   }
   return stack;
 }
 @Override
 public void onPickupFromSlot(
     int slotNumber, IInventory inventory, EntityPlayer player, ItemStack stack) {
   if (slotNumber == 0 && tile.getStackInSlot(0) != null && tile.getStackInSlot(0).stackSize > 0) {
     tile.decrementCraftingField();
   }
 }