Class ServerPing

  • public final class ServerPing
    extends java.lang.Object
    Represents a 1.7 and above server list ping response. This class is immutable.
    • Constructor Detail

      • ServerPing

        public ServerPing​(ServerPing.Version version,
                          @Nullable ServerPing.Players players,
                          net.kyori.adventure.text.Component description,
                          @Nullable Favicon favicon,
                          @Nullable ModInfo modinfo)
        Constructs a ServerPing instance.
        version - the version of the server
        players - the players on the server
        description - the MOTD for the server
        favicon - the server's favicon
        modinfo - the mods this server runs
    • Method Detail

      • getDescription

        public net.kyori.adventure.text.Component getDescription()
      • getFavicon

        public java.util.Optional<Favicon> getFavicon()
      • getModinfo

        public java.util.Optional<ModInfo> getModinfo()
      • toString

        public java.lang.String toString()
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        hashCode in class java.lang.Object
      • asBuilder

        public ServerPing.Builder asBuilder()
        Returns a copy of this ServerPing instance as a builder so that it can be modified. It is guaranteed that ping.asBuilder().build().equals(ping) is true: that is, if no other changes are made to the returned builder, the built instance will equal the original instance.
        a copy of this instance as a ServerPing.Builder