public boolean shouldEndDrag ( int button ) { if ( ! isDraggingItemStack ( ) ) return false ; if ( dragType == DRAG_TYPE_ONE || dragType == DRAG_TYPE_SPREAD ) return dragType == button && draggedSlots . size ( ) > 1 ; return dragType == DRAG_TYPE_PICKUP ; }
Checks if the dragging should end based on the mouse button clicked .