File tree Expand file tree Collapse file tree
proxy/src/main/java/com/velocitypowered/proxy/connection/util Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -57,16 +57,16 @@ private ServerPing constructLocalPing(ProtocolVersion version) {
5757 List <ServerPing .SamplePlayer > samplePlayers ;
5858 if (configuration .getSamplePlayersInPing ()) {
5959 List <ServerPing .SamplePlayer > unshuffledPlayers = server .getAllPlayers ().stream ()
60- .map (p -> {
61- if (p .getPlayerSettings ().isClientListingAllowed ()) {
62- return new ServerPing .SamplePlayer (p .getUsername (), p .getUniqueId ());
63- } else {
64- return ServerPing .SamplePlayer .ANONYMOUS ;
65- }
66- })
67- .collect (Collectors .toList ());
60+ .map (p -> {
61+ if (p .getPlayerSettings ().isClientListingAllowed ()) {
62+ return new ServerPing .SamplePlayer (p .getUsername (), p .getUniqueId ());
63+ } else {
64+ return ServerPing .SamplePlayer .ANONYMOUS ;
65+ }
66+ })
67+ .collect (Collectors .toList ());
6868 Collections .shuffle (unshuffledPlayers );
69- samplePlayers = unshuffledPlayers .subList (0 , Math .min (12 , server . getPlayerCount ()));
69+ samplePlayers = unshuffledPlayers .subList (0 , Math .min (12 , unshuffledPlayers . size ()));
7070 } else {
7171 samplePlayers = ImmutableList .of ();
7272 }
You can’t perform that action at this time.
0 commit comments