File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
src/main/java/pt/supercrafting/menu Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -351,8 +351,9 @@ public void drag(@NotNull InventoryDragEvent event) {
351351
352352 event .setCancelled (false );
353353
354- int amountPerSlot = (int ) Math .floor ((double ) cursor .getAmount () / draggedSlots .size ());
355- int remaining = cursor .getAmount () % draggedSlots .size ();
354+ boolean single = event .getType () == DragType .SINGLE ;
355+ int amountPerSlot = single ? 1 : (int ) Math .floor ((double ) cursor .getAmount () / draggedSlots .size ());
356+ int remaining = single ? cursor .getAmount () - draggedSlots .size () : cursor .getAmount () % draggedSlots .size ();
356357
357358 Player player = (Player ) event .getWhoClicked ();
358359 List <ItemStack > overFlow = new ArrayList <>(draggedSlots .size ());
You can’t perform that action at this time.
0 commit comments