Interface ClientPingServerEvent.Response
- All Superinterfaces:
StatusResponse
- Enclosing interface:
- ClientPingServerEvent
Represents a mutable response to a status request.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Represents the information about the players on the server, sent after theClientPingServerEvent
.static interface
Represents 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.void
setDescription
(Component description) Sets the description (MOTD) of the status response.void
setFavicon
(@Nullable Favicon favicon) Sets theFavicon
to display on the client.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.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:StatusResponse
Gets player count and the list of players currently playing on the server.- Specified by:
players
in 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
-True
if the players should be hidden
-
version
ClientPingServerEvent.Response.Version version()Description copied from interface:StatusResponse
Gets the version of the server displayed when the client or the server are outdated.- Specified by:
version
in interfaceStatusResponse
- Returns:
- The server version
-
setFavicon
Sets theFavicon
to display on the client.- Parameters:
favicon
- The favicon, ornull
for none
-