t3hk0d3/PermissionsEx — Issue #80: Event listening on "Monitor" priority
Author: Evenprime
Created: 2011-10-09 16:00:26+00:00
State: open

Hi. This half bug report, half request:

Problem:

PermissionsEX seems to load permissions for the wrong world after players respawn in another world, sometimes.

My guess:

PermissionsEX listens on LOW priority level for teleport, respawn and portal events, when it should do that instead on MONITOR level priority. By listening on LOW level, all changes made by other plugins to the target destination of these events on NORMAL-HIGHEST level will not be seen or handled by PermissionsEX. If a plugin e.g. changes the respawn location at HIGH level to a different world, PermissionsEX won't notice that (and there are plugins that do that). Because PermissionsEX doesn't modify events, listening on MONITOR level would make much more sense, because then PermissionsEX will see the very last version of the event, with the data that really gets used by bukkit to afterwards teleport the player. Also, then you could (and should) check if an event got cancelled and in that case not reload the permissions for that player, as it would be wrong too, because the player won't change worlds.