feat: add function to directly pass collections in ServerPing.Builder (#1538)
This commit is contained in:
@@ -14,6 +14,7 @@ import com.velocitypowered.api.util.Favicon;
|
|||||||
import com.velocitypowered.api.util.ModInfo;
|
import com.velocitypowered.api.util.ModInfo;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
@@ -196,7 +197,7 @@ public final class ServerPing {
|
|||||||
/**
|
/**
|
||||||
* Uses the modified {@code players} array in the response.
|
* 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
|
* @return this builder, for chaining
|
||||||
*/
|
*/
|
||||||
public Builder samplePlayers(SamplePlayer... players) {
|
public Builder samplePlayers(SamplePlayer... players) {
|
||||||
@@ -204,6 +205,17 @@ public final class ServerPing {
|
|||||||
return this;
|
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.
|
* Uses the modified {@code modType} in the response.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user