diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/modules/rejoin/RejoinModule.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/modules/rejoin/RejoinModule.java index 40771a0ec..94350b659 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/modules/rejoin/RejoinModule.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/modules/rejoin/RejoinModule.java @@ -18,6 +18,7 @@ import org.bukkit.inventory.ItemStack; import mineplex.core.common.util.UtilServer; import mineplex.core.game.rejoin.GameRejoinManager; +import mineplex.core.portal.events.ServerTransferEvent; import nautilus.game.arcade.ArcadeManager; import nautilus.game.arcade.game.GameTeam; @@ -64,6 +65,7 @@ public class RejoinModule extends Module { getGame().QuitOut = true; _rejoinData.clear(); + _manager.searchToRejoin(); } @EventHandler @@ -77,6 +79,17 @@ public class RejoinModule extends Module _disallow.add(event.getPlayer()); } + @EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true) + public void playerTransfer(ServerTransferEvent event) + { + if (!isEnabled()) + { + return; + } + + _disallow.add(event.getPlayer()); + } + @EventHandler(priority = EventPriority.LOW) public void playerQuit(PlayerQuitEvent event) { @@ -86,9 +99,15 @@ public class RejoinModule extends Module } Player player = event.getPlayer(); + + if (_disallow.remove(player) || player.isDead() || !player.getWorld().equals(getGame().WorldData.World)) + { + return; + } + GameTeam team = getGame().GetTeam(player); - if (team == null || !team.IsAlive(player) || getGame().QuitOut || player.isDead() || _disallow.remove(player) || !player.getWorld().equals(getGame().WorldData.World)) + if (team == null || !team.IsAlive(player)) { return; } @@ -181,7 +200,7 @@ public class RejoinModule extends Module private boolean isEnabled() { - return !getGame().getArcadeManager().GetGameHostManager().isPrivateServer() && getGame().InProgress(); + return !getGame().getArcadeManager().GetGameHostManager().isPrivateServer() && getGame().InProgress() && !getGame().QuitOut; } public class PlayerGameInfo