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.Gets the description component currently set in the builder.Gets the favicon currently set in the builder.intGets the maximum player capacity.getMods()Gets the list of mods reported in the ping.Gets the type of mod loader (e.g., "FML").intGets the number of players online.Gets the sample players shown in the ping.Gets the version currently set in the builder.maximumPlayers(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
Gets the version currently set in the builder.- Returns:
- the version
-
getOnlinePlayers
public int getOnlinePlayers()Gets the number of players online.- Returns:
- the online player count
-
getMaximumPlayers
public int getMaximumPlayers()Gets the maximum player capacity.- Returns:
- the max player count
-
getSamplePlayers
Gets the sample players shown in the ping.- Returns:
- the sample player list
-
getDescriptionComponent
Gets the description component currently set in the builder.- Returns:
- the server description, or empty if unset
-
getFavicon
Gets the favicon currently set in the builder.- Returns:
- the favicon, or empty if none
-
getModType
Gets the type of mod loader (e.g., "FML").- Returns:
- the mod type string
-
getMods
Gets the list of mods reported in the ping.- Returns:
- the mod list
-
toString
-