Skip to content

Commit 147d1b8

Browse files
committed
fix: drgging with right click mouse
1 parent 73801ee commit 147d1b8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/pt/supercrafting/menu/MenuClickProcessor.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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());

0 commit comments

Comments
 (0)