Class QueryResponse.Builder
java.lang.Object
com.velocitypowered.api.proxy.server.QueryResponse.Builder
- Enclosing class:
- QueryResponse
A builder for
QueryResponse
objects.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newQueryResponse
with the supplied data.Removes all players from the builder.Clears all currently set plugins.currentPlayers
(int currentPlayers) Sets the players that are currently claimed to be online.gameVersion
(String gameVersion) Sets the game version for the response.Sets the hostname for the response.Sets the map that will appear in the response.maxPlayers
(int maxPlayers) Sets the maximum number of players this server purportedly can hold.Adds the specified players to the player list.players
(Collection<String> players) Adds the specified players to the player list.plugins
(QueryResponse.PluginInformation... plugins) Adds the specified plugins to the plugins list.plugins
(Collection<QueryResponse.PluginInformation> plugins) Adds the specified plugins to the plugins list.Sets the host where this proxy is running.proxyPort
(int proxyPort) Sets the port where this proxy is running.proxyVersion
(String proxyVersion) Sets the proxy version.
-
Method Details
-
hostname
Sets the hostname for the response.- Parameters:
hostname
- the hostname to set- Returns:
- this builder, for chaining
-
gameVersion
Sets the game version for the response.- Parameters:
gameVersion
- the game version to set- Returns:
- this builder, for chaining
-
map
Sets the map that will appear in the response.- Parameters:
map
- the map to set- Returns:
- this builder, for chaining
-
currentPlayers
Sets the players that are currently claimed to be online.- Parameters:
currentPlayers
- a non-negative number representing all players online- Returns:
- this builder, for chaining
-
maxPlayers
Sets the maximum number of players this server purportedly can hold.- Parameters:
maxPlayers
- a non-negative number representing the maximum number of builders- Returns:
- this builder, for chaining
-
proxyHost
Sets the host where this proxy is running.- Parameters:
proxyHost
- the host where the proxy is running- Returns:
- this instance, for chaining
-
proxyPort
Sets the port where this proxy is running.- Parameters:
proxyPort
- the port where the proxy is running- Returns:
- this instance, for chaining
-
players
Adds the specified players to the player list.- Parameters:
players
- the players to add- Returns:
- this builder, for chaining
-
players
Adds the specified players to the player list.- Parameters:
players
- the players to add- Returns:
- this builder, for chaining
-
clearPlayers
Removes all players from the builder. This does not affectQueryResponse.getCurrentPlayers()
.- Returns:
- this builder, for chaining
-
proxyVersion
Sets the proxy version.- Parameters:
proxyVersion
- the proxy version to set- Returns:
- this builder, for chaining
-
plugins
Adds the specified plugins to the plugins list.- Parameters:
plugins
- the plugins to add- Returns:
- this builder, for chaining
-
plugins
Adds the specified plugins to the plugins list.- Parameters:
plugins
- the plugins to add- Returns:
- this builder, for chaining
-
clearPlugins
Clears all currently set plugins.- Returns:
- this builder, for chaining
-
build
Builds a newQueryResponse
with the supplied data. The current instance can be reused after this method is called.- Returns:
- response
-