SteamWar/FightSystem
Archiviert
13
1

Merge pull request 'Shuffle new leader selection' (#388) from shufflePlayer into master
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Reviewed-on: #388
Reviewed-by: YoyoNow <jwsteam@nidido.de>
Dieser Commit ist enthalten in:
Lixfel 2023-04-11 11:43:39 +02:00
Commit 461157714d

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;