Skip to content

Commit 83c1749

Browse files
authored
Add javadoc for ServerPing.Builder (#1500)
* Add javadoc for ServerPing.Builder * Address codestyle reports
1 parent a26d558 commit 83c1749

File tree

1 file changed

+76
-1
lines changed

1 file changed

+76
-1
lines changed

api/src/main/java/com/velocitypowered/api/proxy/server/ServerPing.java

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,31 +159,68 @@ private Builder() {
159159

160160
}
161161

162+
/**
163+
* Uses the modified {@code version} info in the response.
164+
*
165+
* @param version version info to set
166+
* @return this builder, for chaining
167+
*/
162168
public Builder version(Version version) {
163169
this.version = Preconditions.checkNotNull(version, "version");
164170
return this;
165171
}
166172

173+
/**
174+
* Uses the modified {@code onlinePlayers} number in the response.
175+
*
176+
* @param onlinePlayers number for online players to set
177+
* @return this builder, for chaining
178+
*/
167179
public Builder onlinePlayers(int onlinePlayers) {
168180
this.onlinePlayers = onlinePlayers;
169181
return this;
170182
}
171183

184+
/**
185+
* Uses the modified {@code maximumPlayers} number in the response.
186+
* <b>This will not modify the actual maximum players that can join the server.</b>
187+
*
188+
* @param maximumPlayers number for maximum players to set
189+
* @return this builder, for chaining
190+
*/
172191
public Builder maximumPlayers(int maximumPlayers) {
173192
this.maximumPlayers = maximumPlayers;
174193
return this;
175194
}
176195

196+
/**
197+
* Uses the modified {@code players} array in the response.
198+
*
199+
* @param players array of SamplePlayers to set
200+
* @return this builder, for chaining
201+
*/
177202
public Builder samplePlayers(SamplePlayer... players) {
178203
this.samplePlayers.addAll(Arrays.asList(players));
179204
return this;
180205
}
181206

207+
/**
208+
* Uses the modified {@code modType} in the response.
209+
*
210+
* @param modType the mod type to set
211+
* @return this builder, for chaining
212+
*/
182213
public Builder modType(String modType) {
183214
this.modType = Preconditions.checkNotNull(modType, "modType");
184215
return this;
185216
}
186217

218+
/**
219+
* Uses the modified {@code mods} array in the response.
220+
*
221+
* @param mods array of mods to use
222+
* @return this builder, for chaining
223+
*/
187224
public Builder mods(ModInfo.Mod... mods) {
188225
this.mods.addAll(Arrays.asList(mods));
189226
return this;
@@ -193,7 +230,7 @@ public Builder mods(ModInfo.Mod... mods) {
193230
* Uses the modified {@code mods} list in the response.
194231
*
195232
* @param mods the mods list to use
196-
* @return this build, for chaining
233+
* @return this builder, for chaining
197234
*/
198235
public Builder mods(ModInfo mods) {
199236
Preconditions.checkNotNull(mods, "mods");
@@ -203,36 +240,74 @@ public Builder mods(ModInfo mods) {
203240
return this;
204241
}
205242

243+
/**
244+
* Clears the current list of mods to use in the response.
245+
*
246+
* @return this builder, for chaining
247+
*/
206248
public Builder clearMods() {
207249
this.mods.clear();
208250
return this;
209251
}
210252

253+
/**
254+
* Clears the current list of PlayerSamples to use in the response.
255+
*
256+
* @return this builder, for chaining
257+
*/
211258
public Builder clearSamplePlayers() {
212259
this.samplePlayers.clear();
213260
return this;
214261
}
215262

263+
/**
264+
* Defines the server as mod incompatible in the response.
265+
*
266+
* @return this builder, for chaining
267+
*/
216268
public Builder notModCompatible() {
217269
this.nullOutModinfo = true;
218270
return this;
219271
}
220272

273+
/**
274+
* Enables nulling Players in the response.
275+
* This will display the player count as {@code ???}.
276+
*
277+
* @return this builder, for chaining
278+
*/
221279
public Builder nullPlayers() {
222280
this.nullOutPlayers = true;
223281
return this;
224282
}
225283

284+
/**
285+
* Uses the {@code description} Component in the response.
286+
*
287+
* @param description Component to use as the description.
288+
* @return this builder, for chaining
289+
*/
226290
public Builder description(net.kyori.adventure.text.Component description) {
227291
this.description = Preconditions.checkNotNull(description, "description");
228292
return this;
229293
}
230294

295+
/**
296+
* Uses the {@code favicon} in the response.
297+
*
298+
* @param favicon Favicon instance to use.
299+
* @return this builder, for chaining
300+
*/
231301
public Builder favicon(Favicon favicon) {
232302
this.favicon = Preconditions.checkNotNull(favicon, "favicon");
233303
return this;
234304
}
235305

306+
/**
307+
* Clears the current favicon used in the response.
308+
*
309+
* @return this builder, for chaining
310+
*/
236311
public Builder clearFavicon() {
237312
this.favicon = null;
238313
return this;

0 commit comments

Comments
 (0)