lucko / helper

A collection of utilities and extended APIs to support the rapid and easy development of Bukkit plugins.
MIT License
456 stars 87 forks source link

Ensure GUI invalidation on InventoryOpenEvent and InventoryCloseEvent #63

Closed FerusGrim closed 4 years ago

FerusGrim commented 4 years ago

On InventoryCloseEvent, always invalidate the GUI if it's still valid and then only continue on if the inventory being closed is the GUI.

On InventoryOpenEvent, if the inventory that is being opened is not the GUI and the GUI is valid, invalidate it.

lucko commented 4 years ago

Looks ok - I just wonder whether better behaviour would be to cancel the event - to keep the current GUI open?

FerusGrim commented 4 years ago

I'd assume the expected behavior of opening an inventory with a pre-existing inventory already open would be for the new inventory to take priority.

lucko commented 4 years ago

Yeah that's fair

lucko commented 4 years ago

Thank you! :)