Broker Plugin Conflict
gjvnq opened this issue ยท 4 comments
Preliminaries:
- Shopkeepers version:
2.7.2
- PaperMC version:
132
- I have checked that my issue/question does not get answered by:
- The documentation.
- The FAQ.
- The Known Issues.
- I have checked all open and closed issues, but none seems to fit my issue/question.
The issue:
I was receiving the message "Cancelled by another plugin" everytime I tried to edit a shop. Also, the GUI acted strange.
After testing plugin by plugin I discovered that the problem is the Broker plugin.
I tried using bypass-shop-interaction-blocking: true
but it didn't work.
The GUI you are getting is from the Broker plugin. It has a feature to open this everytime you sneak and interact with a villager. If you don't want that feature, maybe ask the author of that plugin to add a config setting for disabling it.
Since both plugins react to the event at the same priority, it might be random (depending on the loading order) which plugin takes over. But since you are seeing the Broker window opening and the Shopkeepers debug message, I would assume that Shopkeepers runs after Broker. So if you have the bypass-shop-interaction-blocking enabled (like you mentioned) then I would assume that it should be able to override (close) the Broker menu by opening its own menu afterwards .. Not sure why that doesn't work here. Could you try again, and verify that you no longer get the 'Cancelled by another plugin' messages after you have enabled that setting? (If you still get these messages, then the setting got not correctly applied for some reason.. maybe you forgot a server/plugin reload?)
However, even if this ends up working, the solution is still suboptimal.
I am currently looking through the event priorities. Changing these to something lower would resolve the issue as well, but ideally Shopkeepers should use an even higher priority than it is using right now since there are usecases in which other plugins should be able to cancel the opening of the menu. So I am not sure yet which priority I will pick for Shopkeepers.
So the ideal solution here would be for Broker to either add a setting to disable this feature, or for them to check whether the villager is a special villager and then ignore the interaction for these (citizens for example attaches the 'NPC' metadata to its entities, and similarly Shopkeepers marks its entities with the 'shopkeeper' metadata).
Hi. I'm the author of Broker. There is a config option in Broker called villagersAreBrokers. You can set this to false to disable the shift right-click interaction so the plugin works only using commands.
@ellbristow
Thanks for pointing out, I was missing the already existing setting!
Between, I just figured out why Shopkeepers 'bypass-shop-interaction-blocking' isn't working in this case:
Broker seems to handle both main and (probably unintended) off-hand interactions (so it will actually open the gui twice per interaction), while Shopkeepers will only open the gui (and therefore bypass other plugins) for the main hand interactions. The sequence of events is (assuming Broker gets enabled first):
- Broker opens GUI for main hand interaction
- Shopkeepers opens GUI for main hand interaction (overriding Broker's GUI)
- Broker opens GUI for off hand interaction (overriding Shopkeepers GUI)
- Shopkeepers is cancelling the event for the off-hand interaction, but not opening the GUI another time.