public ItemStack getStackInSlot(int var1) {
      ItemStack var2 = null;
      Slot var3 = (Slot)this.inventorySlots.get(var1);
      if(var3 != null && var3.getHasStack()) {
         ItemStack var4 = var3.getStack();
         var2 = var4.copy();
         if(var1 == 0) {
            this.func_28125_a(var4, 9, 45, true);
         } else if(var1 >= 9 && var1 < 36) {
            this.func_28125_a(var4, 36, 45, false);
         } else if(var1 >= 36 && var1 < 45) {
            this.func_28125_a(var4, 9, 36, false);
         } else {
            this.func_28125_a(var4, 9, 45, false);
         }

         if(var4.stackSize == 0) {
            var3.putStack((ItemStack)null);
         } else {
            var3.onSlotChanged();
         }

         if(var4.stackSize == var2.stackSize) {
            return null;
         }

         var3.onPickupFromSlot(var4);
      }

      return var2;
   }