Interface ClientPingServerEvent.Response
-
- All Superinterfaces:
StatusResponse
- Enclosing interface:
- ClientPingServerEvent
public static interface ClientPingServerEvent.Response extends StatusResponse
Represents a mutable response to a status request.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ClientPingServerEvent.Response.Players
Represents the information about the players on the server, sent after theClientPingServerEvent
.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Optional<ClientPingServerEvent.Response.Players>
players()
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.-
Methods inherited from interface org.spongepowered.api.network.status.StatusResponse
description, favicon, version
-
-
-
-
Method Detail
-
setDescription
void setDescription(Component description)
Sets the description (MOTD) of the status response.- Parameters:
description
- The description to display
-
players
java.util.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
-
-