Class ServerPing
- java.lang.Object
-
- com.velocitypowered.api.proxy.server.ServerPing
-
public final class ServerPing extends Object
Represents a 1.7 and above server list ping response. This class is immutable.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ServerPing.Builder
A builder forServerPing
objects.static class
ServerPing.Players
static class
ServerPing.SamplePlayer
static class
ServerPing.Version
-
Constructor Summary
Constructors Constructor 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.ServerPing(ServerPing.Version version, @Nullable ServerPing.Players players, net.kyori.text.Component description, @Nullable Favicon favicon)
Deprecated.ServerPing(ServerPing.Version version, @Nullable ServerPing.Players players, net.kyori.text.Component description, @Nullable Favicon favicon, @Nullable ModInfo modinfo)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ServerPing.Builder
asBuilder()
Returns a copy of thisServerPing
instance as a builder so that it can be modified.static ServerPing.Builder
builder()
boolean
equals(Object o)
net.kyori.text.Component
getDescription()
Deprecated.Component
getDescriptionComponent()
Optional<Favicon>
getFavicon()
Optional<ModInfo>
getModinfo()
Optional<ServerPing.Players>
getPlayers()
ServerPing.Version
getVersion()
int
hashCode()
String
toString()
-
-
-
Constructor Detail
-
ServerPing
@Deprecated public ServerPing(ServerPing.Version version, @Nullable ServerPing.Players players, net.kyori.text.Component description, @Nullable Favicon favicon)
Deprecated.
-
ServerPing
public ServerPing(ServerPing.Version version, @Nullable ServerPing.Players players, Component description, @Nullable Favicon favicon)
-
ServerPing
@Deprecated public ServerPing(ServerPing.Version version, @Nullable ServerPing.Players players, net.kyori.text.Component description, @Nullable Favicon favicon, @Nullable ModInfo modinfo)
Deprecated.Constructs a ServerPing instance.- Parameters:
version
- the version of the serverplayers
- the players on the serverdescription
- the MOTD for the serverfavicon
- the server's faviconmodinfo
- the mods this server runs
-
ServerPing
public ServerPing(ServerPing.Version version, @Nullable ServerPing.Players players, Component description, @Nullable Favicon favicon, @Nullable ModInfo modinfo)
Constructs a ServerPing instance.- Parameters:
version
- the version of the serverplayers
- the players on the serverdescription
- the MOTD for the serverfavicon
- the server's faviconmodinfo
- the mods this server runs
-
-
Method Detail
-
getVersion
public ServerPing.Version getVersion()
-
getPlayers
public Optional<ServerPing.Players> getPlayers()
-
getDescription
@Deprecated public net.kyori.text.Component getDescription()
Deprecated.
-
getDescriptionComponent
public Component getDescriptionComponent()
-
asBuilder
public ServerPing.Builder asBuilder()
Returns a copy of thisServerPing
instance as a builder so that it can be modified. It is guaranteed thatping.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.- Returns:
- a copy of this instance as a
ServerPing.Builder
-
builder
public static ServerPing.Builder builder()
-
-