Geolykt / EnchantmentsPlus

Enchantments+, a Bukkit Custom Enchantments Plugin based on Zenchantments targetted at production grade servers
GNU General Public License v3.0
38 stars 15 forks source link

Fire enchantment not respecting break permission (WorldGuard) #47

Closed chrismwiggs closed 3 years ago

chrismwiggs commented 3 years ago

If you setup a region with WorldGuard and try to mine a sand block with a shovel enchanted with Fire, it cancels the block break event but still drops a glass block.

I assume this is the same case anywhere you are unable to build due to any plugin it seems, not just WorldGuard (but that's probably the most common cause).

Paper 1.16.5 Echant+ 3.1.4

Geolykt commented 3 years ago

Oh wow, this is the main reason the fork got created so it's a bit strange that it is reproducible, but I will take a look, I guess I fricked up an old update again

Geolykt commented 3 years ago

I will try to reproduce it tomorrow, however looking at the code this should not be possible unless WG is doing strange shit with it's event handler priority. Also, why would be building permission affect this, I changed the title of the issue report in thinking that this was a typo, however reading it again this might not have been a typo.

Anyways, thanks for the bug report.

chrismwiggs commented 3 years ago

Break is more accurate, but in testing other plugins that restrict block breaking, it's tied to build permissions (like KindomsX for example). But essentially anywhere you can't break a block it's happening (was reported first in a World guard region though!)

Geolykt commented 3 years ago

We have a native block permission querying system that we can fall back to if it is really needed, but those tend to be a bit costly

Geolykt commented 3 years ago

I have put a workaround in place by using the beforementionend Native Permission Query, however this is really a workaround from either a bug in Enchantment+'s Codebase or a bug in WG's codebase. As of yet we are honouring the cancellation state as well as using the MONITOR priority, so unless WG cancels the event at MONITOR priority, this cannot be an issue.

If you did report this issue to any other plugin, could I get a link to these? I would be very interested in their stance as I doubt that they made a bug this significant, however I could also not imagine this bug resurfacing a year after being fixed.

chrismwiggs commented 3 years ago

Great! I'll give it a try and see how it works.

The only other plugin I have right now that restricts breaking like this is KingdomX https://www.spigotmc.org/resources/kingdomsx.77670/(not open source, unfortunately). Also Advanced Region Market https://www.spigotmc.org/resources/advancedregionmarket.58732/ but that directly uses WorldGuard. I didn't report this bug to them though because it feels like it is something that lives in Enchants plus. Not sure how Enchants plus even checks for when a player is allowed to do something, but it makes sense to me that it's still canceling the block break (like with shred, it doesn't allow you to dig any of the blocks it usually could) but doesn't/isn't able to cancel the dropping of the glass blocks. The expected behaviour from WG is working fine, it's just the non-standard stuff like dropping a new block that isn't being stopped. If that makes sense? I can show you if not!

On Thu, Apr 8, 2021 at 1:32 PM Geolykt @.***> wrote:

I have put a workaround in place by using the beforementionend Native Permission Query, however this is really a workaround from either a bug in Enchantment+'s Codebase or a bug in WG's codebase. As of yet we are honouring the cancellation state as well as using the MONITOR priority, so unless WG cancels the event at MONITOR priority, this cannot be an issue.

If you did report this issue to any other plugin, could I get a link to these? I would be very interested in their stance as I doubt that they made a bug this significant, however I could also not imagine this bug resurfacing a year after being fixed.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/Geolykt/EnchantmentsPlus/issues/47#issuecomment-816008333, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABRTJ6PEA4CIOE524N7CJNLTHXSEBANCNFSM42RI57QA .

-- CHRIS WIGGS UX Designer + Frontend Developer

647 772-5205 www.chrismwiggs.com