refactoring
This commit is contained in:
@@ -34,5 +34,16 @@ public final class SessionJoinedMessage extends ServerMessage implements Respons
|
||||
this.player = player;
|
||||
this.players = List.copyOf(players);
|
||||
this.secret = secret;
|
||||
|
||||
boolean found = false;
|
||||
for (var playerData : players) {
|
||||
if (playerData.getUuid().equals(player)) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
throw new IllegalArgumentException("Player not contained in players.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user