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

Broker Plugin Conflict #589

Closed
gjvnq opened this issue Jul 17, 2019 · 4 comments
Closed

Broker Plugin Conflict #589

gjvnq opened this issue Jul 17, 2019 · 4 comments
Assignees
Labels
incompatibility Caused by a buggy, misbehaving or incompatible other plugin.

Comments

@gjvnq
Copy link

gjvnq commented Jul 17, 2019

Preliminaries:

  • Shopkeepers version: 2.7.2
  • PaperMC version: 132

  • I have checked that my issue/question does not get answered by:
  • 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.
Screenshot from 2019-07-17 04-07-34

@gjvnq gjvnq changed the title Multiverse Conflict Broker Plugin Conflict Jul 17, 2019
@blablubbabc blablubbabc self-assigned this Jul 17, 2019
@blablubbabc blablubbabc added the incompatibility Caused by a buggy, misbehaving or incompatible other plugin. label Jul 17, 2019
@blablubbabc
Copy link
Member

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).

@ellbristow
Copy link

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.

@blablubbabc
Copy link
Member

@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.

@gjvnq
Copy link
Author

gjvnq commented Jul 18, 2019

Thanks. The setting villagersAreBrokers did work!

@gjvnq gjvnq closed this as completed Jul 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incompatibility Caused by a buggy, misbehaving or incompatible other plugin.
Projects
None yet
Development

No branches or pull requests

3 participants