-
Bug
-
Resolution: Invalid
-
Minor
-
None
-
None
I was attempting to prevent players from dragging items across their inventory when I came across an issue. Simply listening to InventoryDragEvent, checking if event.getInventory() is an instance of PlayerInventory (or getType() is InventoryType.PLAYER) then cancelling the event does not work. I printed out the class name of getInventory() along with the enum name of getType() and to my surprise, it printed out 'CraftingInventory' and 'CRAFTING'. Is there a reason why the inventory type is crafting rather than the player's inventory? If this is a bug, a fix of this may break old plugins that thought CraftingInventory was the correct type and do things based on that event, so I'd recommend a new method (e.g. getDraggedInventory()) and deprecating getInventory() if this was to be fixed.