SteamWar/FightSystem
Archiviert
13
1

Shuffle new leader selection #388

Zusammengeführt
Lixfel hat 1 Commits von shufflePlayer nach master 2023-04-11 11:43:40 +02:00 zusammengeführt
Nur Änderungen aus Commit a726166dc3 werden angezeigt - Alle Commits anzeigen

Datei anzeigen

@ -219,7 +219,9 @@ public class FightTeam {
playerSet.forEach(p -> addMember(p, true)); playerSet.forEach(p -> addMember(p, true));
if(ArenaMode.VariableTeams.contains(Config.mode) && isLeaderless()){ if(ArenaMode.VariableTeams.contains(Config.mode) && isLeaderless()){
for(Player player : Bukkit.getOnlinePlayers()){ List<Player> onlinePlayers = new ArrayList<>(Bukkit.getOnlinePlayers());
Collections.shuffle(onlinePlayers);
for(Player player : onlinePlayers) {
if(Fight.getPlayerTeam(player) == null && canbeLeader(player)){ if(Fight.getPlayerTeam(player) == null && canbeLeader(player)){
addMember(player); addMember(player);
break; break;