public final class ServerPing extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ServerPing.Builder
A builder for
ServerPing objects. |
static class |
ServerPing.Players |
static class |
ServerPing.SamplePlayer |
static class |
ServerPing.Version |
| Constructor and Description |
|---|
ServerPing(ServerPing.Version version,
@Nullable ServerPing.Players players,
Component description,
@Nullable Favicon favicon) |
ServerPing(ServerPing.Version version,
@Nullable ServerPing.Players players,
Component description,
@Nullable Favicon favicon,
@Nullable ModInfo modinfo)
Constructs a ServerPing instance.
|
| Modifier and Type | Method and Description |
|---|---|
ServerPing.Builder |
asBuilder()
Returns a copy of this
ServerPing instance as a builder so that it can be modified. |
static ServerPing.Builder |
builder() |
boolean |
equals(Object o) |
Component |
getDescription() |
Optional<Favicon> |
getFavicon() |
Optional<ModInfo> |
getModinfo() |
Optional<ServerPing.Players> |
getPlayers() |
ServerPing.Version |
getVersion() |
int |
hashCode() |
String |
toString() |
public ServerPing(ServerPing.Version version, @Nullable ServerPing.Players players, Component description, @Nullable Favicon favicon)
public ServerPing(ServerPing.Version version, @Nullable ServerPing.Players players, Component description, @Nullable Favicon favicon, @Nullable ModInfo modinfo)
version - the version of the serverplayers - the players on the serverdescription - the MOTD for the serverfavicon - the server's faviconmodinfo - the mods this server runspublic ServerPing.Version getVersion()
public Optional<ServerPing.Players> getPlayers()
public Component getDescription()
public ServerPing.Builder asBuilder()
ServerPing instance as a builder so that it can be modified.
It is guaranteed that ping.asBuilder().ping().equals(ping): that is, if no other
changes are made to the returned builder, the built instance will equal the original instance.ServerPing.Builderpublic static ServerPing.Builder builder()