Skip to content

Commit 0fe17ec

Browse files
authored
Merge pull request #4 from PaperMC/dev/3.0.0
[pull] main from PaperMC:dev/3.0.0
2 parents 66f453d + 83c1749 commit 0fe17ec

File tree

5 files changed

+76
-9
lines changed

5 files changed

+76
-9
lines changed

api/src/main/java/com/velocitypowered/api/event/command/PlayerAvailableCommandsEvent.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
import static com.google.common.base.Preconditions.checkNotNull;
1111

12-
import com.google.common.annotations.Beta;
1312
import com.mojang.brigadier.tree.RootCommandNode;
1413
import com.velocitypowered.api.event.annotation.AwaitingEvent;
1514
import com.velocitypowered.api.proxy.Player;
@@ -21,7 +20,6 @@
2120
* client.
2221
*/
2322
@AwaitingEvent
24-
@Beta
2523
public class PlayerAvailableCommandsEvent {
2624

2725
private final Player player;

api/src/main/java/com/velocitypowered/api/event/player/ServerPostConnectEvent.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
package com.velocitypowered.api.event.player;
99

10-
import com.google.common.annotations.Beta;
1110
import com.google.common.base.Preconditions;
1211
import com.velocitypowered.api.proxy.Player;
1312
import com.velocitypowered.api.proxy.server.RegisteredServer;
@@ -18,7 +17,6 @@
1817
* available in {@link Player#getCurrentServer()}. Velocity will not wait on this event to finish
1918
* firing.
2019
*/
21-
@Beta
2220
public class ServerPostConnectEvent {
2321
private final Player player;
2422
private final RegisteredServer previousServer;

api/src/main/java/com/velocitypowered/api/event/proxy/server/ServerRegisteredEvent.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
package com.velocitypowered.api.event.proxy.server;
99

10-
import com.google.common.annotations.Beta;
1110
import com.google.common.base.Preconditions;
1211
import com.velocitypowered.api.proxy.server.RegisteredServer;
1312
import com.velocitypowered.api.proxy.server.ServerInfo;
@@ -23,7 +22,6 @@
2322
* @param registeredServer A {@link RegisteredServer} that has been registered.
2423
* @since 3.3.0
2524
*/
26-
@Beta
2725
public record ServerRegisteredEvent(@NotNull RegisteredServer registeredServer) {
2826
public ServerRegisteredEvent {
2927
Preconditions.checkNotNull(registeredServer, "registeredServer");

api/src/main/java/com/velocitypowered/api/event/proxy/server/ServerUnregisteredEvent.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
package com.velocitypowered.api.event.proxy.server;
99

10-
import com.google.common.annotations.Beta;
1110
import com.google.common.base.Preconditions;
1211
import com.velocitypowered.api.proxy.server.RegisteredServer;
1312
import com.velocitypowered.api.proxy.server.ServerInfo;
@@ -23,7 +22,6 @@
2322
* @param unregisteredServer A {@link RegisteredServer} that has been unregistered.
2423
* @since 3.3.0
2524
*/
26-
@Beta
2725
public record ServerUnregisteredEvent(@NotNull RegisteredServer unregisteredServer) {
2826
public ServerUnregisteredEvent {
2927
Preconditions.checkNotNull(unregisteredServer, "unregisteredServer");

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)