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
Modifier and TypeClassDescriptionstatic final class
A builder forServerPing
objects.static final class
Represents what the players the server purports to have online, its maximum capacity, and a sample of players on the server.static final class
A player returned in the sample field of the server ping players field.static final class
Represents the version of the server sent to the client. -
Constructor Summary
ConstructorDescriptionServerPing
(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 thisServerPing
instance as a builder so that it can be modified.static ServerPing.Builder
builder()
boolean
int
hashCode()
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 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
-