File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ plugins {
55
66
77group = ' net.staticstudios'
8- version = ' 1.0.11 -SNAPSHOT'
8+ version = ' 1.0.12 -SNAPSHOT'
99
1010repositories {
1111 mavenCentral()
Original file line number Diff line number Diff line change @@ -62,15 +62,13 @@ void onButtonClick(InventoryClickEvent e) {
6262 if (inSlot == null || inSlot .getType ().isEmpty ()) {
6363 e .getInventory ().setItem (slot , e .getCurrentItem ());
6464 e .getCurrentItem ().setAmount (0 );
65- return ;
65+ } else {
66+ int amountToMove = Math .min (e .getCurrentItem ().getAmount (), inSlot .getMaxStackSize () - inSlot .getAmount ());
67+ inSlot .setAmount (inSlot .getAmount () + amountToMove );
68+ e .getInventory ().setItem (slot , inSlot );
69+ e .getCurrentItem ().setAmount (e .getCurrentItem ().getAmount () - amountToMove );
6670 }
6771
68- int amountToMove = Math .min (e .getCurrentItem ().getAmount (), inSlot .getMaxStackSize () - inSlot .getAmount ());
69-
70- inSlot .setAmount (inSlot .getAmount () + amountToMove );
71- e .getInventory ().setItem (slot , inSlot );
72- e .getCurrentItem ().setAmount (e .getCurrentItem ().getAmount () - amountToMove );
73-
7472 Bukkit .getScheduler ().runTaskLater (StaticMenus .getPlugin (), () -> {
7573 Player player = Bukkit .getPlayer (playerId );
7674 if (player != null && interactableMenu == player .getOpenInventory ().getTopInventory ().getHolder (false )) {
You can’t perform that action at this time.
0 commit comments