From 7f7fb1631ce973a01945a9beb37f9dc1eaf111ad Mon Sep 17 00:00:00 2001 From: Andreas Troelsen Date: Wed, 19 Aug 2020 22:55:23 +0200 Subject: [PATCH] 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. --- changelog.md | 1 + .../com/garbagemule/MobArena/listeners/MAGlobalListener.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index 6eb5b62..9a4effe 100644 --- a/changelog.md +++ b/changelog.md @@ -18,6 +18,7 @@ These changes will (most likely) be included in the next version. - 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. - 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. - 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. diff --git a/src/main/java/com/garbagemule/MobArena/listeners/MAGlobalListener.java b/src/main/java/com/garbagemule/MobArena/listeners/MAGlobalListener.java index e3d4085..e9da435 100644 --- a/src/main/java/com/garbagemule/MobArena/listeners/MAGlobalListener.java +++ b/src/main/java/com/garbagemule/MobArena/listeners/MAGlobalListener.java @@ -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)) {