Class ServerPing.Builder
- java.lang.Object
-
- com.velocitypowered.api.proxy.server.ServerPing.Builder
-
- Enclosing class:
- ServerPing
public static final class ServerPing.Builder extends java.lang.Object
A builder forServerPing
objects.
-
-
Method Summary
-
-
-
Method Detail
-
version
public ServerPing.Builder version(ServerPing.Version version)
-
onlinePlayers
public ServerPing.Builder onlinePlayers(int onlinePlayers)
-
maximumPlayers
public ServerPing.Builder maximumPlayers(int maximumPlayers)
-
samplePlayers
public ServerPing.Builder samplePlayers(ServerPing.SamplePlayer... players)
-
modType
public ServerPing.Builder modType(java.lang.String modType)
-
mods
public ServerPing.Builder mods(ModInfo.Mod... mods)
-
mods
public ServerPing.Builder mods(ModInfo mods)
Uses the modifiedmods
list in the response.- Parameters:
mods
- the mods list to use- Returns:
- this build, for chaining
-
clearMods
public ServerPing.Builder clearMods()
-
clearSamplePlayers
public ServerPing.Builder clearSamplePlayers()
-
notModCompatible
public ServerPing.Builder notModCompatible()
-
nullPlayers
public ServerPing.Builder nullPlayers()
-
description
public ServerPing.Builder description(net.kyori.adventure.text.Component description)
-
favicon
public ServerPing.Builder favicon(Favicon favicon)
-
clearFavicon
public ServerPing.Builder clearFavicon()
-
build
public ServerPing build()
Uses the information from this builder to create a newServerPing
instance. The builder can be re-used after this event has been called.- Returns:
- a new
ServerPing
instance
-
getVersion
public ServerPing.Version getVersion()
-
getOnlinePlayers
public int getOnlinePlayers()
-
getMaximumPlayers
public int getMaximumPlayers()
-
getSamplePlayers
public java.util.List<ServerPing.SamplePlayer> getSamplePlayers()
-
getDescription
public java.util.Optional<net.kyori.adventure.text.Component> getDescription()
-
getFavicon
public java.util.Optional<Favicon> getFavicon()
-
getModType
public java.lang.String getModType()
-
getMods
public java.util.List<ModInfo.Mod> getMods()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-