File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
src/main/java/com/github/elic0de/hungergames/game Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 22
33import com .github .elic0de .eliccommon .game .AbstractGame ;
44import com .github .elic0de .eliccommon .game .phase .Phase ;
5+ import com .github .elic0de .eliccommon .user .OnlineUser ;
56import com .github .elic0de .eliccommon .util .ItemBuilder ;
67import com .github .elic0de .hungergames .HungerGames ;
78import com .github .elic0de .hungergames .chest .DeathChest ;
@@ -72,7 +73,9 @@ public void leave(GameUser user) {
7273 }
7374
7475 public void randomTeam () {
75- getPlayers ().forEach (user -> scoreboard .getTeams ().stream ().min (Comparator .comparing (Team ::getSize )).ifPresent (team -> team .addEntry (user .getUsername ())));
76+ final List <OnlineUser > users = new ArrayList <>(getPlayers ());
77+ Collections .shuffle (users );
78+ users .forEach (user -> scoreboard .getTeams ().stream ().min (Comparator .comparing (Team ::getSize )).ifPresent (team -> team .addEntry (user .getUsername ())));
7679 }
7780
7881 public void startGame (Player player ) {
You can’t perform that action at this time.
0 commit comments