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 newServerPinginstance.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 thedescriptionComponent in the response.Uses thefaviconin the response.intgetMods()intmaximumPlayers(int maximumPlayers) Uses the modifiedmaximumPlayersnumber in the response.Uses the modifiedmodslist in the response.mods(ModInfo.Mod... mods) Uses the modifiedmodsarray in the response.Uses the modifiedmodTypein the response.Defines the server as mod incompatible in the response.Enables nulling Players in the response.onlinePlayers(int onlinePlayers) Uses the modifiedonlinePlayersnumber in the response.samplePlayers(ServerPing.SamplePlayer... players) Uses the modifiedplayersarray in the response.samplePlayers(Collection<ServerPing.SamplePlayer> players) Uses the modifiedplayerscollection in the response.toString()version(ServerPing.Version version) Uses the modifiedversioninfo in the response.
-
Method Details
-
version
Uses the modifiedversioninfo in the response.- Parameters:
version- version info to set- Returns:
- this builder, for chaining
-
onlinePlayers
Uses the modifiedonlinePlayersnumber in the response.- Parameters:
onlinePlayers- number for online players to set- Returns:
- this builder, for chaining
-
maximumPlayers
Uses the modifiedmaximumPlayersnumber 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 modifiedplayersarray in the response.- Parameters:
players- array of SamplePlayers to add- Returns:
- this builder, for chaining
-
samplePlayers
Uses the modifiedplayerscollection in the response.- Parameters:
players- collection of SamplePlayers to add- Returns:
- this builder, for chaining
-
modType
Uses the modifiedmodTypein the response.- Parameters:
modType- the mod type to set- Returns:
- this builder, for chaining
-
mods
Uses the modifiedmodsarray in the response.- Parameters:
mods- array of mods to use- Returns:
- this builder, for chaining
-
mods
Uses the modifiedmodslist 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 thedescriptionComponent in the response.- Parameters:
description- Component to use as the description.- Returns:
- this builder, for chaining
-
favicon
Uses thefaviconin 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 newServerPinginstance. The builder can be re-used after this event has been called.- Returns:
- a new
ServerPinginstance
-
getVersion
-
getOnlinePlayers
public int getOnlinePlayers() -
getMaximumPlayers
public int getMaximumPlayers() -
getSamplePlayers
-
getDescriptionComponent
-
getFavicon
-
getModType
-
getMods
-
toString
-