From a726166dc30413d7ea022a047f6d35e20e39ea18 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Tue, 11 Apr 2023 11:37:31 +0200 Subject: [PATCH] Shuffle new leader selection Signed-off-by: Lixfel --- .../src/de/steamwar/fightsystem/fight/FightTeam.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/FightSystem_Core/src/de/steamwar/fightsystem/fight/FightTeam.java b/FightSystem_Core/src/de/steamwar/fightsystem/fight/FightTeam.java index dac4135..70036c7 100644 --- a/FightSystem_Core/src/de/steamwar/fightsystem/fight/FightTeam.java +++ b/FightSystem_Core/src/de/steamwar/fightsystem/fight/FightTeam.java @@ -219,7 +219,9 @@ public class FightTeam { playerSet.forEach(p -> addMember(p, true)); if(ArenaMode.VariableTeams.contains(Config.mode) && isLeaderless()){ - for(Player player : Bukkit.getOnlinePlayers()){ + List onlinePlayers = new ArrayList<>(Bukkit.getOnlinePlayers()); + Collections.shuffle(onlinePlayers); + for(Player player : onlinePlayers) { if(Fight.getPlayerTeam(player) == null && canbeLeader(player)){ addMember(player); break;