Bump to HIGHEST priority for PlayerRespawnEvent.

Plugins like Multiverse and EssentialsX have features that override the
world spawn location for players respawning both with and without bed
locations. If MobArena catches the PlayerRespawnEvent too early, these
plugins will likely overwrite the respawn location set for players that
respawn after dying in an arena session.

Because MobArena is a minigame and its respawn manipulation logic only
runs for respawning arena players, it is perfectly reasonable for it to
get the final say in where these players should respawn. It would have
been nice to just use `HIGH`, but that is what EssentialsX runs at, so
we gotta go higher than that.
This commit is contained in:
Andreas Troelsen
2020-08-19 22:55:23 +02:00
parent 84a7a2ed8a
commit 7f7fb1631c
2 changed files with 2 additions and 1 deletions
@@ -333,7 +333,7 @@ public class MAGlobalListener implements Listener
arena.getEventListener().onPlayerQuit(event);
}
@EventHandler(priority = EventPriority.NORMAL)
@EventHandler(priority = EventPriority.HIGHEST)
public void playerRespawn(PlayerRespawnEvent event) {
for (Arena arena : am.getArenas()) {
if (arena.getEventListener().onPlayerRespawn(event)) {