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

View File

@ -18,6 +18,7 @@ These changes will (most likely) be included in the next version.
- Boss names now support color codes. - Boss names now support color codes.
- The Root Target ability now uses potion effects (slowness, slow falling, and negative jump boost) instead of repeated teleports. This should make for a smoother root experience. - The Root Target ability now uses potion effects (slowness, slow falling, and negative jump boost) instead of repeated teleports. This should make for a smoother root experience.
- Using `spectate-on-death: true` no longer forces players out to their join location/exit warp before moving them to the spectator area. This should prevent "jumpy" behavior in multi-world setups. - Using `spectate-on-death: true` no longer forces players out to their join location/exit warp before moving them to the spectator area. This should prevent "jumpy" behavior in multi-world setups.
- Players should now properly respawn at the spectator area rather than at world spawn on servers with plugins that override respawn locations.
- Config-files with missing `pet-items` nodes no longer errors. A missing `pet-items` node in `global-settings` is treated as empty, i.e. no pet items will be registered. - Config-files with missing `pet-items` nodes no longer errors. A missing `pet-items` node in `global-settings` is treated as empty, i.e. no pet items will be registered.
- The `player-time-in-arena` setting has been fixed. - The `player-time-in-arena` setting has been fixed.
- The `soft-restore` setting has been fixed for blocks broken by players. Note that the functionality is still unreliable for non-trivial blocks. - The `soft-restore` setting has been fixed for blocks broken by players. Note that the functionality is still unreliable for non-trivial blocks.

View File

@ -333,7 +333,7 @@ public class MAGlobalListener implements Listener
arena.getEventListener().onPlayerQuit(event); arena.getEventListener().onPlayerQuit(event);
} }
@EventHandler(priority = EventPriority.NORMAL) @EventHandler(priority = EventPriority.HIGHEST)
public void playerRespawn(PlayerRespawnEvent event) { public void playerRespawn(PlayerRespawnEvent event) {
for (Arena arena : am.getArenas()) { for (Arena arena : am.getArenas()) {
if (arena.getEventListener().onPlayerRespawn(event)) { if (arena.getEventListener().onPlayerRespawn(event)) {