Record Class BackendServerConfig
java.lang.Object
java.lang.Record
com.velocitypowered.api.proxy.config.BackendServerConfig
- Record Components:
address- the hostname or address of the backend serverforwardingMode- the forwarding mode to use when forwarding player information to this backend server
@NullMarked
public record BackendServerConfig(String address, @Nullable PlayerInfoForwarding forwardingMode)
extends Record
Exposes server configuration information that plugins may use.
What's the forwarding mode?
The server can use a different mode to obtain and forward player info. For instance,
if you are running a 1.12 (or lower version) server on a Velocity proxy with MODERN
player info forwarding, the server does not support MODERN forwarding. In this case,
you must set the forwarding mode for that server to PlayerInfoForwarding.LEGACY,
and Velocity will use the legacy mode only for that backend server.
Additionally, if the forwarding mode is null it means that the server is using the
"player-info-forwarding-mode", set in the configuration.
- Since:
- 3.4.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionBackendServerConfig(String address) Creates a newBackendServerConfigwith the given address, using the default.BackendServerConfig(String address, @Nullable PlayerInfoForwarding forwardingMode) Creates a newBackendServerConfig. -
Method Summary
Modifier and TypeMethodDescriptionaddress()Returns the value of theaddressrecord component.final booleanIndicates whether some other object is "equal to" this one.@Nullable PlayerInfoForwardingReturns the value of theforwardingModerecord component.final inthashCode()Returns a hash code value for this object.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
BackendServerConfig
Creates a newBackendServerConfig.- Parameters:
address- the hostname or address of the backend serverforwardingMode- the forwarding mode for this backend server- Throws:
NullPointerException- ifaddressorforwardingModeis null
-
BackendServerConfig
Creates a newBackendServerConfigwith the given address, using the default.- Parameters:
address- the hostname or address of the backend server- Throws:
NullPointerException- ifaddressis null
-
-
Method Details
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
address
Returns the value of theaddressrecord component.- Returns:
- the value of the
addressrecord component
-
forwardingMode
Returns the value of theforwardingModerecord component.- Returns:
- the value of the
forwardingModerecord component
-