Interface ClientPingServerEvent.Response
- All Superinterfaces:
StatusResponse
- Enclosing interface:
ClientPingServerEvent
Represents a mutable response to a status request.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceRepresents the information about the players on the server, sent after theClientPingServerEvent.static interfaceRepresents the information about the version of the server, sent after theClientPingServerEvent. -
Method Summary
Modifier and TypeMethodDescriptionplayers()Gets player count and the list of players currently playing on the server.voidsetDescription(Component description) Sets the description (MOTD) of the status response.voidsetFavicon(@Nullable Favicon favicon) Sets theFaviconto display on the client.voidsetHidePlayers(boolean hide) Sets whether the player count and the list of players on this server is hidden and doesn't get sent to the client.version()Gets the version of the server displayed when the client or the server are outdated.Methods inherited from interface org.spongepowered.api.network.status.StatusResponse
description, favicon
-
Method Details
-
setDescription
Sets the description (MOTD) of the status response.- Parameters:
description- The description to display
-
players
Optional<ClientPingServerEvent.Response.Players> players()Description copied from interface:StatusResponseGets player count and the list of players currently playing on the server.- Specified by:
playersin interfaceStatusResponse- Returns:
- The player information, or
Optional.empty()if not available
-
setHidePlayers
void setHidePlayers(boolean hide) Sets whether the player count and the list of players on this server is hidden and doesn't get sent to the client. This will restoreplayers()if the players were previously hidden.Use
players().isPresent()to check if the players are already hidden.In Vanilla, this will display
???instead of the player count in the server list.- Parameters:
hide-Trueif the players should be hidden
-
version
ClientPingServerEvent.Response.Version version()Description copied from interface:StatusResponseGets the version of the server displayed when the client or the server are outdated.- Specified by:
versionin interfaceStatusResponse- Returns:
- The server version
-
setFavicon
Sets theFaviconto display on the client.- Parameters:
favicon- The favicon, ornullfor none
-