Class ResponseData

java.lang.Object
net.minestom.server.ping.ResponseData

public class ResponseData extends Object
Represents the data sent to the player when responding to a ping event.
See Also:
  • Constructor Details

    • ResponseData

      public ResponseData()
      Constructs a new ResponseData.
  • Method Details

    • setVersion

      public void setVersion(String version)
      Sets the version name for the response.
      Parameters:
      version - The version name for the response data.
    • getVersion

      public String getVersion()
      Get the version name for the response.
      Returns:
      the version name for the response.
    • setProtocol

      public void setProtocol(int protocol)
      Sets the response protocol version.
      Parameters:
      protocol - The protocol version for the response data.
    • getProtocol

      public int getProtocol()
      Get the response protocol version.
      Returns:
      the response protocol version.
    • setMaxPlayer

      public void setMaxPlayer(int maxPlayer)
      Sets the response maximum player count.
      Parameters:
      maxPlayer - The maximum player count for the response data.
    • getMaxPlayer

      public int getMaxPlayer()
      Get the response maximum player count.
      Returns:
      the response maximum player count.
    • setOnline

      public void setOnline(int online)
      Sets the response online count.
      Parameters:
      online - The online count for the response data.
    • getOnline

      public int getOnline()
      Get the response online count.
      Returns:
      the response online count.
    • setDescription

      public void setDescription(Component description)
      Sets the response description.
      Parameters:
      description - The description for the response data.
    • getDescription

      public Component getDescription()
      Get the response description
      Returns:
      the response description
    • setFavicon

      public void setFavicon(String favicon)
      Sets the response favicon.

      MUST start with "data:image/png;base64,"

      Parameters:
      favicon - The favicon for the response data.
    • getFavicon

      public String getFavicon()
      Get the response favicon.
      Returns:
      the response favicon.
    • addEntry

      public void addEntry(@NotNull @NotNull NamedAndIdentified entry)
      Adds an entry to the response data sample. This can be a player or a custom object.
      Parameters:
      entry - the entry
      See Also:
    • addEntries

      public void addEntries(@NotNull @NotNull NamedAndIdentified... entries)
      Adds a series of entries to the response data sample. These can be players or a custom object.
      Parameters:
      entries - the entries
      See Also:
    • addEntries

      public void addEntries(@NotNull @NotNull Collection<? extends NamedAndIdentified> entries)
      Adds a series of entries to the response data sample. These can be players or a custom object.
      Parameters:
      entries - the entries
      See Also:
    • clearEntries

      public void clearEntries()
      Clears the entries.
    • getEntries

      @NotNull public @NotNull Collection<NamedAndIdentified> getEntries()
      Gets a modifiable collection of the current entries.
      Returns:
      the entries
    • setPlayersHidden

      public void setPlayersHidden(boolean playersHidden)
      Sets whether the players are hidden or not. In the vanilla client, `???` will be displayed where the online and maximum players would be.
      Parameters:
      playersHidden - if the players are hidden
    • arePlayersHidden

      public boolean arePlayersHidden()
      Returns if the players are hidden or not.
      Returns:
      if the players are hidden