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 server
forwardingMode - 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 Details

    • BackendServerConfig

      public BackendServerConfig(String address, @Nullable PlayerInfoForwarding forwardingMode)
      Creates a new BackendServerConfig.
      Parameters:
      address - the hostname or address of the backend server
      forwardingMode - the forwarding mode for this backend server
      Throws:
      NullPointerException - if address or forwardingMode is null
    • BackendServerConfig

      public BackendServerConfig(String address)
      Creates a new BackendServerConfig with the given address, using the default.
      Parameters:
      address - the hostname or address of the backend server
      Throws:
      NullPointerException - if address is null
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • address

      public String address()
      Returns the value of the address record component.
      Returns:
      the value of the address record component
    • forwardingMode

      public @Nullable PlayerInfoForwarding forwardingMode()
      Returns the value of the forwardingMode record component.
      Returns:
      the value of the forwardingMode record component