Skip to content

Commit

Permalink
Fix the previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Gaming32 committed Feb 25, 2024
1 parent 67627d9 commit a9c8736
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -512,10 +512,10 @@ private static int randomizeTeams(
Integer groupCount
) throws CommandSyntaxException {
final ServerScoreboard scoreboard = context.getSource().getServer().getScoreboard();
List<PlayerTeam> teams = new ArrayList<>(scoreboard.getPlayerTeams());
final List<PlayerTeam> teams = new ArrayList<>(scoreboard.getPlayerTeams());
Collections.shuffle(teams);
if (groupCount != null) {
teams.subList(0, Math.min(groupCount, teams.size()));
if (groupCount != null && groupCount < teams.size()) {
teams.subList(groupCount, teams.size()).clear();
}
if (teams.isEmpty()) {
throw NO_TEAMS.create();
Expand Down

0 comments on commit a9c8736

Please sign in to comment.