SamJakob / SpiGUI

A comprehensive GUI API for Spigot with pages support.
MIT License
107 stars 21 forks source link

Added a fix to check if the clicked inventory is the GUI and not player's own inventory #20

Closed MCreeper12731 closed 1 year ago

MCreeper12731 commented 1 year ago

Addresses issue: https://github.com/SamJakob/SpiGUI/issues/19

SamJakob commented 1 year ago

Hi, Thanks for your PR! I just noticed that I use event.getInventory instead of event.getClickedInventory on lines 28 - are you able to see if removing your new check and swapping getInventory with getClickedInventory work?

MCreeper12731 commented 1 year ago

Changed according to the instructions. There needs to be an additional check if clicked inventory is not null (occurs when the player clicks outside of the inventory UI)

SamJakob commented 1 year ago

All good, thanks! Did you get a chance to test this?

MCreeper12731 commented 1 year ago

Yes, tested, and it now works only if you click in the GUI. I can send a video if you need proof

SamJakob commented 1 year ago

Nope that's good enough for me! Thank you :)