Class QueryResponse


  • public final class QueryResponse
    extends Object
    GS4 query response. This class is immutable.
    • Method Detail

      • hostname

        public String hostname()
        Get hostname which will be used to reply to the query. By default it is ProxyConfig.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
      • 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
      • toBuilder

        public QueryResponse.Builder toBuilder()
        Creates a new QueryResponse.Builder instance from data represented by this response, so that you may create a new QueryResponse with new data. It is guaranteed that queryResponse.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:
        QueryResponse builder
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object