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 classQueryResponse.BuilderA builder forQueryResponseobjects.static classQueryResponse.PluginInformationRepresents a plugin in the query response.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static QueryResponse.Builderbuilder()Creates a newQueryResponse.Builderinstance.booleanequals(Object o)StringgameVersion()Get game version which will be used to reply to the query.inthashCode()Stringhostname()Get hostname which will be used to reply to the query.StringmapName()Get map name which will be used to reply to the query.intmaxPlayers()Get max player count which will be used to reply to the query.intonlinePlayers()Get current online player count which will be used to reply to the query.Collection<String>players()Get collection of players which will be used to reply to the query.Collection<QueryResponse.PluginInformation>plugins()Get list of plugins which will be used to reply to the query.StringproxyHost()Get proxy (public facing) hostname.intproxyPort()Get proxy (public facing) port.StringproxyVersion()Get server software (name and version) which will be used to reply to the query.QueryResponse.BuildertoBuilder()Creates a newQueryResponse.Builderinstance from data represented by this response, so that you may create a newQueryResponsewith new data.StringtoString()
-
-
-
Method Detail
-
hostname
public String hostname()
Get hostname which will be used to reply to the query. By default it isProxyConfig.getMotd()in plain text without colour codes.- Returns:
- hostname
-
gameVersion
public String gameVersion()
Get game version which will be used to reply to the query. By default supported Minecraft versions range is sent.- Returns:
- game version
-
mapName
public String mapName()
Get map name which will be used to reply to the query. By defaultProxyConfig.getQueryMap()is sent.- Returns:
- map name
-
onlinePlayers
public int onlinePlayers()
Get current online player count which will be used to reply to the query.- Returns:
- online player count
-
maxPlayers
public int maxPlayers()
Get max player count which will be used to reply to the query.- Returns:
- max player count
-
proxyHost
public String proxyHost()
Get proxy (public facing) hostname.- Returns:
- proxy hostname
-
proxyPort
public int proxyPort()
Get proxy (public facing) port.- Returns:
- proxy port
-
players
public Collection<String> players()
Get collection of players which will be used to reply to the query.- Returns:
- collection of players
-
proxyVersion
public String proxyVersion()
Get server software (name and version) which will be used to reply to the query.- Returns:
- server software
-
plugins
public Collection<QueryResponse.PluginInformation> plugins()
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.Builderinstance from data represented by this response, so that you may create a newQueryResponsewith 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:
QueryResponsebuilder
-
builder
public static QueryResponse.Builder builder()
Creates a newQueryResponse.Builderinstance.- Returns:
QueryResponsebuilder
-
-