diff --git a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/TeamSurvivalGames.java b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/TeamSurvivalGames.java index 7c6563b33..f1bb3754b 100644 --- a/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/TeamSurvivalGames.java +++ b/Plugins/Nautilus.Game.Arcade/src/nautilus/game/arcade/game/games/survivalgames/TeamSurvivalGames.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.List; import mineplex.core.common.util.C; +import mineplex.core.common.util.UtilPlayer; import mineplex.core.common.util.UtilTime; import mineplex.core.common.util.UtilTime.TimeUnit; import mineplex.core.updater.UpdateType; @@ -210,12 +211,7 @@ public class TeamSurvivalGames extends SurvivalGames @Override protected void deathmatchTeleport() { - List spawns = new ArrayList<>(); - - for (GameTeam team : GetTeamList()) - { - spawns.addAll(team.GetSpawns()); - } + List spawns = GetTeamList().get(0).GetSpawns(); List spectators = GetPlayers(false); @@ -227,23 +223,6 @@ public class TeamSurvivalGames extends SurvivalGames spectators.forEach(s -> s.teleport(spectatorLocation)); - // Find the number of spaces between each player, - int spacesBetween = Math.max(Math.floorDiv(spawns.size(), living.size()), 1); - int spaceIndex = 0; - - // Teleport the players to locations every [spacesBetween] spaces - for (Player player : living) - { - GameTeam team = GetTeam(player); - List teamPlayers = team.GetPlayers(true); - - for (int teamIndex = 0; teamIndex < teamPlayers.size(); teamIndex++) - { - player.teleport(spawns.get(spaceIndex + teamIndex)); - } - - // Wrap around if it overflows - spaceIndex = (spaceIndex + spacesBetween) % spawns.size(); - } + UtilPlayer.teleportUniform(living, spawns); } }