Jikoo / OpenInv

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

Random Bad Interaction with Brewery #184

Closed GeneralSarcasam closed 5 months ago

GeneralSarcasam commented 6 months ago

I've had Brewery (https://github.com/DieReicheErethons/Brewery) and OpenInv on my server together for the better part of 3 years now, and always had a bug where Admins couldn't open Brewery barrels. It was never a significant enough issue for us that I bothered to figure out what was going on with it, but I sat down today to figure it out.

Turns out, my Admin group had the permissions 'openinv.anychest' and 'openinv.silent.default', both of which prevent you from opening a Brewery barrel for some reason.

I don't really expect this to be something you prioritize, but I made this discovery and figured even if you decide it's not worth fixing, you could get a good laugh out of it.

Thanks!

Jikoo commented 6 months ago

Best guess is that the brewery plugin listens for interactions at the same priority as OI. OI is relying on the fact that plugins are not supposed to modify the event in that priority, so any plugin changing the outcome should already have done its thing. Brewery prevents OI from opening the actual inventory of the barrel, but does not open its own barrel interface because the interaction was cancelled late by OI to prevent the container actually opening and making noise.

Honestly, imo the solution you have found where silentcontainer is not on by default is the best easy solution here - leaving admin powers on when you don't need them is generally not a great way to go.

Do brewery barrels make a sound when opened like normal barrels do, or are they entirely separate?

GeneralSarcasam commented 5 months ago

They make the regular Barrel noise when opened, despite being a multiblock structure

Jikoo commented 5 months ago

Doesn't look like OI can address this. Brewery plays those sounds itself. https://github.com/DieReicheErethons/Brewery/blob/ba75403f3b3fae391adfd7fcccd360365cae4757/src/com/dre/brewery/listeners/PlayerListener.java#L149 There doesn't appear to be any way to skip this while letting Brewery do its own barrel opening.

Jikoo commented 5 months ago

For clarity, reason this is won'tfix is because to fix it one would have to unregister Brewery's interaction listener and enable a modified copy. The alternative is multiple barrel multiblock lookups, and depending on how they handle multiblock detection that may be very inefficient.