diff --git a/api/src/main/java/com/velocitypowered/api/proxy/server/ServerPing.java b/api/src/main/java/com/velocitypowered/api/proxy/server/ServerPing.java index a7d9518f..f927228e 100644 --- a/api/src/main/java/com/velocitypowered/api/proxy/server/ServerPing.java +++ b/api/src/main/java/com/velocitypowered/api/proxy/server/ServerPing.java @@ -159,31 +159,68 @@ public final class ServerPing { } + /** + * Uses the modified {@code version} info in the response. + * + * @param version version info to set + * @return this builder, for chaining + */ public Builder version(Version version) { this.version = Preconditions.checkNotNull(version, "version"); return this; } + /** + * Uses the modified {@code onlinePlayers} number in the response. + * + * @param onlinePlayers number for online players to set + * @return this builder, for chaining + */ public Builder onlinePlayers(int onlinePlayers) { this.onlinePlayers = onlinePlayers; return this; } + /** + * Uses the modified {@code maximumPlayers} number in the response. + * This will not modify the actual maximum players that can join the server. + * + * @param maximumPlayers number for maximum players to set + * @return this builder, for chaining + */ public Builder maximumPlayers(int maximumPlayers) { this.maximumPlayers = maximumPlayers; return this; } + /** + * Uses the modified {@code players} array in the response. + * + * @param players array of SamplePlayers to set + * @return this builder, for chaining + */ public Builder samplePlayers(SamplePlayer... players) { this.samplePlayers.addAll(Arrays.asList(players)); return this; } + /** + * Uses the modified {@code modType} in the response. + * + * @param modType the mod type to set + * @return this builder, for chaining + */ public Builder modType(String modType) { this.modType = Preconditions.checkNotNull(modType, "modType"); return this; } + /** + * Uses the modified {@code mods} array in the response. + * + * @param mods array of mods to use + * @return this builder, for chaining + */ public Builder mods(ModInfo.Mod... mods) { this.mods.addAll(Arrays.asList(mods)); return this; @@ -193,7 +230,7 @@ public final class ServerPing { * Uses the modified {@code mods} list in the response. * * @param mods the mods list to use - * @return this build, for chaining + * @return this builder, for chaining */ public Builder mods(ModInfo mods) { Preconditions.checkNotNull(mods, "mods"); @@ -203,36 +240,74 @@ public final class ServerPing { return this; } + /** + * Clears the current list of mods to use in the response. + * + * @return this builder, for chaining + */ public Builder clearMods() { this.mods.clear(); return this; } + /** + * Clears the current list of PlayerSamples to use in the response. + * + * @return this builder, for chaining + */ public Builder clearSamplePlayers() { this.samplePlayers.clear(); return this; } + /** + * Defines the server as mod incompatible in the response. + * + * @return this builder, for chaining + */ public Builder notModCompatible() { this.nullOutModinfo = true; return this; } + /** + * Enables nulling Players in the response. + * This will display the player count as {@code ???}. + * + * @return this builder, for chaining + */ public Builder nullPlayers() { this.nullOutPlayers = true; return this; } + /** + * Uses the {@code description} Component in the response. + * + * @param description Component to use as the description. + * @return this builder, for chaining + */ public Builder description(net.kyori.adventure.text.Component description) { this.description = Preconditions.checkNotNull(description, "description"); return this; } + /** + * Uses the {@code favicon} in the response. + * + * @param favicon Favicon instance to use. + * @return this builder, for chaining + */ public Builder favicon(Favicon favicon) { this.favicon = Preconditions.checkNotNull(favicon, "favicon"); return this; } + /** + * Clears the current favicon used in the response. + * + * @return this builder, for chaining + */ public Builder clearFavicon() { this.favicon = null; return this;