Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin does not check if the clicked inventory is the actual GUI #19

Closed
MCreeper12731 opened this issue Mar 11, 2023 · 4 comments
Closed

Comments

@MCreeper12731
Copy link
Contributor

There is a known issue in Spigot when checking the inventory's clicked slot number because of the slot numbering system (picture included)
image
I fixed this issue by adding an additional fix
if (event.getClickedInventory() == null || event.getClickedInventory().getType() == InventoryType.PLAYER) return;
which checks if the inventory that was clicked was actually the upper part of the UI, otherwise the listener also let's through clicks that were done in the player inventory and act as if they were done in the GUI. But adding this everytime is a bit tedious. Sorry if the explanation is a bit confusing, I can go over certain parts again if you don't understand the problem

@SamJakob
Copy link
Owner

Oh I see what you mean. I recall this issue and must have just forgotten to implement a fix for this. I can’t do anything on this for the next couple of weeks but after I might be able to take a look.

Otherwise if you can submit a PR I’m happy to merge.

@MCreeper12731
Copy link
Contributor Author

MCreeper12731 commented Mar 12, 2023

Submitted a PR, I hope I did everything correctly, I'm still new to GitHub
Fixed in #20

@SamJakob
Copy link
Owner

Thanks for your PR just had a look and noticed a potentially simpler way of doing it. Replied to #20

@SamJakob
Copy link
Owner

Closed with #20.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants