lishid / OpenInv

Open anyone's inventory as a chest, real-time!
GNU General Public License v3.0
119 stars 94 forks source link

Add support for InvUnload #146

Closed mfnalex closed 4 years ago

mfnalex commented 4 years ago

This will check if the PlayerInteractEvent is an instance of InvUnload's custom event extending the PlayerInteractEvent. If yes, the listener immediately exists, because it doesn't have to do anything.

This is checked by using Event#getClass#getName, so that no dependencies need to be added. It has no downsides at all, so it would be nice if you could consider merging this PR.

This will not cancel 3rd party plugins' events that extend PlayerInteractEvent.

This fixes #144

Jikoo commented 4 years ago

Looks good, thanks!