Nested Zone Support for Exit/Entry Messages[1.12.2] [FEATURE]
Erokaution opened this issue ยท 0 comments
Please describe.
Zone A has a exit and entry message. Zone B is within the bounds of Zone A.
Whenever a player walks in and out of Zone B, it triggers Zone A's entry/exit messages, despite the player technically remaining in Zone A the entire time, as confirmed with /p list zones while in Zone B.
So if there's a zone nested within the bounds of another zone, I'd ideally like it so the parenting zones exit/enter messages don't get triggered unless the player actually leaves the bounds of the parenting zone.
Describe the solution you'd like
I've looked through the source a bit, and the thing that's causing this is in ZonedPermissionHelper, specifically the playerChangedZoneEvent method and how it's call is handled in the playerMoveEvent method.
The before and after zone checks are only done on the first zone in the list, which changes depending on which zone you most recently entered.
As an alternative I'd suggest getting the before and after arrays, checking if there's any entries removed or added into the after array compared to the before array, and act on the entries that are removed/added instead of only the most recent.
I actually have no idea if this is a bug or intended. It feels like this should be a bug, but I tagged it as feature just in case.
I have absolutely zero idea how gradle or git works, else I'd try my hand at fixing it myself :c