Class ServerPreConnectEvent
java.lang.Object
com.nickuc.login.api.event.internal.velocity.VelocityCancellableEvent
com.nickuc.login.api.event.velocity.connection.ServerPreConnectEvent
- All Implemented Interfaces:
CancellableEvent
,EventWithPlayer
Event triggered when a server connection operation is initiated for a player.
Not available for PROXY
implementations.
- Since:
- API v8
-
Constructor Summary
ConstructorsConstructorDescriptionServerPreConnectEvent
(com.velocitypowered.api.proxy.Player player, ServerConnectType serverConnectType, com.velocitypowered.api.proxy.server.RegisteredServer originalServer) -
Method Summary
Modifier and TypeMethodDescriptioncom.velocitypowered.api.proxy.server.RegisteredServer
Returns the server originally used to connect.com.velocitypowered.api.proxy.Player
Returns the player instance.com.velocitypowered.api.proxy.server.RegisteredServer
Returns the server used to connect.Returns the type of connection used in this event.void
setServer
(com.velocitypowered.api.proxy.server.RegisteredServer server) Defines the server that will be used for the connection.Methods inherited from class com.nickuc.login.api.event.internal.velocity.VelocityCancellableEvent
isCancelled, setCancelled
-
Constructor Details
-
ServerPreConnectEvent
public ServerPreConnectEvent(com.velocitypowered.api.proxy.Player player, ServerConnectType serverConnectType, com.velocitypowered.api.proxy.server.RegisteredServer originalServer)
-
-
Method Details
-
getPlayer
public com.velocitypowered.api.proxy.Player getPlayer()Returns the player instance.- Specified by:
getPlayer
in interfaceEventWithPlayer
-
getServerConnectType
Returns the type of connection used in this event. -
getOriginalServer
public com.velocitypowered.api.proxy.server.RegisteredServer getOriginalServer()Returns the server originally used to connect. -
getServer
public com.velocitypowered.api.proxy.server.RegisteredServer getServer()Returns the server used to connect. -
setServer
public void setServer(@Nonnull com.velocitypowered.api.proxy.server.RegisteredServer server) Defines the server that will be used for the connection.- Parameters:
server
- the server used for the connection.
-