-
Bug
-
Resolution: Done
-
Minor
-
None
-
None
-
Windows 10
Java 1.8.0_202
-
This server is running CraftBukkit version git-Spigot-ae72bf4-183139d (MC: 1.15.2) (Implementing API version 1.15.2-R0.1-SNAPSHOT)
-
Yes
I added the following listener to my plugin:
@EventHandler public void onClick(InventoryClickEvent e) { e.setCancelled(true); e.getWhoClicked().sendMessage("You clicked on " + e.getCurrentItem()); }
For the most part, this works as expected: The event is cancelled (cannot take item out of the inventory) and a message about the clicked item is displayed.
However, when I perform a fast double-click (like when collecting items to cursor) while holding shift, it seems to print the message twice (because of double-click) and then once again for every similar ItemStack in the inventory.
Example: If there are 5 diamonds in slots of the inventory, the message will be printed 7 times (2 times for the doubleclick - OK, and 5 times again for every diamond - Bug?).
If we had a chest inventory with a diamond in every slot, and we shift-double-clicked one of them, the message would be printed 29 times.
This also seems to occur when the amounts on the ItemStacks differ (Doesn't matter if it's one diamond in the slot or 64).
===
What I'm trying to achieve: I'm working on an Inventory API and would like to allow users to use normal clicks or shift-click. However, due to the aforementioned behaviour, I have to disallow shift-clicks as a safety measure.