code: private ItemStack handleDoubleClick(MalisisInventory inventory, MalisisSlot slot, boolean shiftClick)
  	{
  		if (!inventory.state.is(PLAYER_EXTRACT))
  			return ItemStack.EMPTY;
  
  		// normal double click, go through all hovered slot inventory to merge the slots with the currently picked one
  		if (!shiftClick && !pickedItemStack.isEmpty())
  		{
  			for (int i = 0; i < 2; i++)
  			{
  				for (MalisisInventory inv : getInventories())
  					if (inv.pullItemStacks(pickedItemStack, i == 0))
  						break;
  				if (pickedItemStack.getCount() < pickedItemStack.getMaxStackSize())
  					getPlayerInventory().pullItemStacks(pickedItemStack, i == 0);
  			}
  
  			setPickedItemStack(pickedItemStack);
  		}
  		// shift double click, go through all hovered slot's inventory to transfer matching itemStack to the other inventory
  		else if (!lastShiftClicked.isEmpty())
  		{
  			//transfer all matching itemStack into other inventories
  			if (inventory == getPlayerInventory())
  			{
  
  			}
  
  			for (MalisisSlot s : inventory.getNonEmptySlots())
  			{
  				ItemStack itemStack = s.getItemStack();
  				if (s.isState(PLAYER_EXTRACT) && ItemUtils.areItemStacksStackable(itemStack, lastShiftClicked))
  				{
  					itemStack = transferSlotOutOfInventory(inventory, s);
  					//replace what's left of the item back into the slot
  					slot.setItemStack(itemStack);
  					slot.onSlotChanged();
  					//itemStack is not empty, inventory is full, no need to keep looping the slots
  					if (!itemStack.isEmpty())
  						return itemStack;
  				}
  
  			}
  		}
  		lastShiftClicked = ItemStack.EMPTY;
  		return ItemStack.EMPTY;
  	}
docs: Handle double clicking on a slot.
  
  @param inventoryId the inventory id
  @param slot the slot
  @param shiftClick the shift click
  @return the item stack