use teleportUniform in Build

This commit is contained in:
Spencer 2017-12-18 13:35:36 -05:00 committed by Alexander Meech
parent 16905240e9
commit bef403a72c

View File

@ -823,22 +823,7 @@ public class Build extends Game
Player[] players = UtilServer.getPlayers();
// Find the number of spaces between each player,
int spacesBetween = Math.max(Math.floorDiv(edgeLocations.size(), players.length), 1);
int spaceIndex = 0;
// Teleport the players to locations every [spacesBetween] spaces
for (Player player : players)
{
teleportPlayer(player, edgeLocations.get(spaceIndex));
spaceIndex += spacesBetween;
if (spaceIndex > edgeLocations.size())
{
spaceIndex = 0;
}
}
UtilPlayer.teleportUniform(Arrays.asList(players), edgeLocations, this::teleportPlayer);
}
public BuildData getBuildData(Player player)