Skip to content

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

Merged
SamJakob merged 3 commits intoSamJakob:masterfrom
MCreeper12731:master
Mar 12, 2023
Merged

Added a fix to check if the clicked inventory is the GUI and not player's own inventory#20
SamJakob merged 3 commits intoSamJakob:masterfrom
MCreeper12731:master

Conversation

@MCreeper12731
Copy link
Copy Markdown
Contributor

@SamJakob
Copy link
Copy Markdown
Owner

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
Copy link
Copy Markdown
Contributor Author

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
Copy link
Copy Markdown
Owner

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

@MCreeper12731
Copy link
Copy Markdown
Contributor Author

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

@SamJakob
Copy link
Copy Markdown
Owner

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

@SamJakob SamJakob merged commit 9b244e8 into SamJakob:master Mar 12, 2023
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

Successfully merging this pull request may close these issues.

2 participants