Class ServerPing
java.lang.Object
com.velocitypowered.api.proxy.server.ServerPing
Represents a 1.7 and above server list ping response. This class is immutable.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA builder forServerPingobjects.static final classRepresents what the players the server purports to have online, its maximum capacity, and a sample of players on the server.static final classA player returned in the sample field of the server ping players field.static final classRepresents the version of the server sent to the client. -
Constructor Summary
ConstructorsConstructorDescriptionServerPing(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
Modifier and TypeMethodDescriptionReturns a copy of thisServerPinginstance as a builder so that it can be modified.static ServerPing.Builderbuilder()booleaninthashCode()toString()
-
Constructor Details
-
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 Details
-
getVersion
-
getPlayers
-
getDescriptionComponent
-
getFavicon
-
getModinfo
-
toString
-
equals
-
hashCode
public int hashCode() -
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
-