EpicEricEE / ShopChest

ShopChest - Spigot/Bukkit Plugin
MIT License
45 stars 57 forks source link

Shop uses cancelled PlayerInteractEvent & PlayerInteractAtEntityEvent #64

Closed jkobus closed 7 years ago

jkobus commented 7 years ago

My plugin (offline authentication) cancels those events with the "lowest" priority, but the shop is still using them. The same problem can be reproduced by using the Authme Reloaded plugin - if the player is in range of a chest, he won't be able to move but he will be able to trade with the shop.

EpicEricEE commented 7 years ago

I was about to fix that when I realized, if I blocked all cancelled interaction events, a player wouldn't even be allowed use a shop on a protected chest (from LWC or similar). The only thing I could do, would be adding support for AuthMe, but as there is no way to add support for all plugins of that kind, it would be the only one this plugin would support.

jkobus commented 7 years ago

You are right. ShopChest is able to protect the chest by itself (then why someone would use LWC)?

EpicEricEE commented 7 years ago

Maybe a server adds LWC protection automatically when placing a chest, and someone doesn't notice, makes a shop on that chest and then others couldn't use it.

Or another thing I just faced: I installed ASkyBlock to try what is happening with shops and visitors of the island couldn't use it, because ASkyBlock cancelled the interaction events. The only thing I could have done was allowing visitors to open chests and to interact and damage armor stands.

jkobus commented 7 years ago

So the problem is that the interaction with shop is blocked by other plugins that treat it like a normal chest therefore the "cancelled" flag must be ignored.

I was also thinking about using ShopBuySellEvent but it is emitted after the transaction is made and then you compensate it if event was cancelled?

EpicEricEE commented 7 years ago

Yes, I haven't found another way of firing the event wihout having the chance of the buy or sell failing