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 classServerPing.BuilderA builder forServerPingobjects.static classServerPing.PlayersRepresents what the players the server purports to have online, its maximum capacity, and a sample of players on the server.static classServerPing.SamplePlayerA player returned in the sample field of the server ping players field.static classServerPing.VersionRepresents the version of the server sent to the client.
-
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.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ServerPing.BuilderasBuilder()Returns a copy of thisServerPinginstance as a builder so that it can be modified.static ServerPing.Builderbuilder()booleanequals(Object o)ComponentgetDescriptionComponent()Optional<Favicon>getFavicon()Optional<ModInfo>getModinfo()Optional<ServerPing.Players>getPlayers()ServerPing.VersiongetVersion()inthashCode()StringtoString()
-
-
-
Constructor Detail
-
ServerPing
public ServerPing(ServerPing.Version version, @Nullable ServerPing.Players players, Component description, @Nullable Favicon favicon)
-
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()
-
getDescriptionComponent
public Component getDescriptionComponent()
-
asBuilder
public ServerPing.Builder asBuilder()
Returns a copy of thisServerPinginstance 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()
-
-