Class ServerInfo
java.lang.Object
com.velocitypowered.api.proxy.server.ServerInfo
- All Implemented Interfaces:
Comparable<ServerInfo>
ServerInfo represents a server that a player can connect to. This object is immutable and safe
for concurrent access.
-
Constructor Summary
ConstructorsConstructorDescriptionServerInfo(String name, InetSocketAddress address) Creates a new ServerInfo object.ServerInfo(String name, InetSocketAddress address, @Nullable PlayerInfoForwarding forwardingMode) Creates a new ServerInfo object. -
Method Summary
Modifier and TypeMethodDescriptionintbooleanGets the network address of the server.getName()Gets the name of the server.@Nullable PlayerInfoForwardingReturns the forwarding mode used by the backend server to communicate with Velocity.inthashCode()toString()
-
Constructor Details
-
ServerInfo
public ServerInfo(String name, InetSocketAddress address, @Nullable PlayerInfoForwarding forwardingMode) Creates a new ServerInfo object.- Parameters:
name- the name for the serveraddress- the address of the server to connect toforwardingMode- the server info forwarding mode, ornullif the mode from the config should be used- Since:
- 3.4.0
-
ServerInfo
Creates a new ServerInfo object.- Parameters:
name- the name for the serveraddress- the address of the server to connect to
-
-
Method Details
-
getName
Gets the name of the server.- Returns:
- the name of the server
-
getPlayerInfoForwardingMode
Returns the forwarding mode used by the backend server to communicate with Velocity.- Returns:
- the configured forwarding mode for the server, or
nullif the mode is inherited from the "player-info-forwarding-mode" set in the config
-
getAddress
Gets the network address of the server.- Returns:
- the
InetSocketAddressof the server
-
toString
-
equals
-
hashCode
public int hashCode() -
compareTo
- Specified by:
compareToin interfaceComparable<ServerInfo>
-