Class ServerPing.Builder
java.lang.Object
com.velocitypowered.api.proxy.server.ServerPing.Builder
- Enclosing class:
- ServerPing
A builder for
ServerPing
objects.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Uses the information from this builder to create a newServerPing
instance.Clears the current favicon used in the response.Clears the current list of mods to use in the response.Clears the current list of PlayerSamples to use in the response.description
(Component description) Uses thedescription
Component in the response.Uses thefavicon
in the response.int
getMods()
int
maximumPlayers
(int maximumPlayers) Uses the modifiedmaximumPlayers
number in the response.Uses the modifiedmods
list in the response.mods
(ModInfo.Mod... mods) Uses the modifiedmods
array in the response.Uses the modifiedmodType
in the response.Defines the server as mod incompatible in the response.Enables nulling Players in the response.onlinePlayers
(int onlinePlayers) Uses the modifiedonlinePlayers
number in the response.samplePlayers
(ServerPing.SamplePlayer... players) Uses the modifiedplayers
array in the response.toString()
version
(ServerPing.Version version) Uses the modifiedversion
info in the response.
-
Method Details
-
version
Uses the modifiedversion
info in the response.- Parameters:
version
- version info to set- Returns:
- this builder, for chaining
-
onlinePlayers
Uses the modifiedonlinePlayers
number in the response.- Parameters:
onlinePlayers
- number for online players to set- Returns:
- this builder, for chaining
-
maximumPlayers
Uses the modifiedmaximumPlayers
number in the response. This will not modify the actual maximum players that can join the server.- Parameters:
maximumPlayers
- number for maximum players to set- Returns:
- this builder, for chaining
-
samplePlayers
Uses the modifiedplayers
array in the response.- Parameters:
players
- array of SamplePlayers to set- Returns:
- this builder, for chaining
-
modType
Uses the modifiedmodType
in the response.- Parameters:
modType
- the mod type to set- Returns:
- this builder, for chaining
-
mods
Uses the modifiedmods
array in the response.- Parameters:
mods
- array of mods to use- Returns:
- this builder, for chaining
-
mods
Uses the modifiedmods
list in the response.- Parameters:
mods
- the mods list to use- Returns:
- this builder, for chaining
-
clearMods
Clears the current list of mods to use in the response.- Returns:
- this builder, for chaining
-
clearSamplePlayers
Clears the current list of PlayerSamples to use in the response.- Returns:
- this builder, for chaining
-
notModCompatible
Defines the server as mod incompatible in the response.- Returns:
- this builder, for chaining
-
nullPlayers
Enables nulling Players in the response. This will display the player count as???
.- Returns:
- this builder, for chaining
-
description
Uses thedescription
Component in the response.- Parameters:
description
- Component to use as the description.- Returns:
- this builder, for chaining
-
favicon
Uses thefavicon
in the response.- Parameters:
favicon
- Favicon instance to use.- Returns:
- this builder, for chaining
-
clearFavicon
Clears the current favicon used in the response.- Returns:
- this builder, for chaining
-
build
Uses the information from this builder to create a newServerPing
instance. The builder can be re-used after this event has been called.- Returns:
- a new
ServerPing
instance
-
getVersion
-
getOnlinePlayers
public int getOnlinePlayers() -
getMaximumPlayers
public int getMaximumPlayers() -
getSamplePlayers
-
getDescriptionComponent
-
getFavicon
-
getModType
-
getMods
-
toString
-