Class QueryResponse
- java.lang.Object
-
- com.velocitypowered.api.proxy.server.QueryResponse
-
public final class QueryResponse extends Object
GS4 query response. This class is immutable.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
QueryResponse.Builder
A builder forQueryResponse
objects.static class
QueryResponse.PluginInformation
Represents a plugin in the query response.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static QueryResponse.Builder
builder()
Creates a newQueryResponse.Builder
instance.boolean
equals(Object o)
int
getCurrentPlayers()
Get current online player count which will be used to reply to the query.String
getGameVersion()
Get game version which will be used to reply to the query.String
getHostname()
Get hostname which will be used to reply to the query.String
getMap()
Get map name which will be used to reply to the query.int
getMaxPlayers()
Get max player count which will be used to reply to the query.Collection<String>
getPlayers()
Get collection of players which will be used to reply to the query.Collection<QueryResponse.PluginInformation>
getPlugins()
Get list of plugins which will be used to reply to the query.String
getProxyHost()
Get proxy (public facing) hostname.int
getProxyPort()
Get proxy (public facing) port.String
getProxyVersion()
Get server software (name and version) which will be used to reply to the query.int
hashCode()
QueryResponse.Builder
toBuilder()
Creates a newQueryResponse.Builder
instance from data represented by this response, so that you may create a newQueryResponse
with new data.String
toString()
-
-
-
Method Detail
-
getHostname
public String getHostname()
Get hostname which will be used to reply to the query. By default it isProxyConfig.getMotd()
in plain text without colour codes.- Returns:
- hostname
-
getGameVersion
public String getGameVersion()
Get game version which will be used to reply to the query. By default supported Minecraft versions range is sent.- Returns:
- game version
-
getMap
public String getMap()
Get map name which will be used to reply to the query. By defaultProxyConfig.getQueryMap()
is sent.- Returns:
- map name
-
getCurrentPlayers
public int getCurrentPlayers()
Get current online player count which will be used to reply to the query.- Returns:
- online player count
-
getMaxPlayers
public int getMaxPlayers()
Get max player count which will be used to reply to the query.- Returns:
- max player count
-
getProxyHost
public String getProxyHost()
Get proxy (public facing) hostname.- Returns:
- proxy hostname
-
getProxyPort
public int getProxyPort()
Get proxy (public facing) port.- Returns:
- proxy port
-
getPlayers
public Collection<String> getPlayers()
Get collection of players which will be used to reply to the query.- Returns:
- collection of players
-
getProxyVersion
public String getProxyVersion()
Get server software (name and version) which will be used to reply to the query.- Returns:
- server software
-
getPlugins
public Collection<QueryResponse.PluginInformation> getPlugins()
Get list of plugins which will be used to reply to the query.- Returns:
- collection of plugins
-
toBuilder
public QueryResponse.Builder toBuilder()
Creates a newQueryResponse.Builder
instance from data represented by this response, so that you may create a newQueryResponse
with new data. It is guaranteed thatqueryResponse.toBuilder().build().equals(queryResponse)
: that is, if no other changes are made to the returned builder, the built instance will equal the original instance.- Returns:
QueryResponse
builder
-
builder
public static QueryResponse.Builder builder()
Creates a newQueryResponse.Builder
instance.- Returns:
QueryResponse
builder
-
-