feat: add function to directly pass collections in ServerPing.Builder (#1538)

This commit is contained in:
Timon Seidel
2025-03-30 19:49:36 +02:00
committed by GitHub
parent d2cd79185b
commit c3d10bd410

View File

@@ -14,6 +14,7 @@ import com.velocitypowered.api.util.Favicon;
import com.velocitypowered.api.util.ModInfo;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
@@ -196,7 +197,7 @@ public final class ServerPing {
/**
* Uses the modified {@code players} array in the response.
*
* @param players array of SamplePlayers to set
* @param players array of SamplePlayers to add
* @return this builder, for chaining
*/
public Builder samplePlayers(SamplePlayer... players) {
@@ -204,6 +205,17 @@ public final class ServerPing {
return this;
}
/**
* Uses the modified {@code players} collection in the response.
*
* @param players collection of SamplePlayers to add
* @return this builder, for chaining
*/
public Builder samplePlayers(Collection<SamplePlayer> players) {
this.samplePlayers.addAll(players);
return this;
}
/**
* Uses the modified {@code modType} in the response.
*