Class ServerPreConnectEventImpl
- java.lang.Object
-
- com.velocitypowered.api.event.player.ServerPreConnectEventImpl
-
- All Implemented Interfaces:
Event,ServerPreConnectEvent,ResultedEvent<ServerPreConnectEvent.ServerResult>
public final class ServerPreConnectEventImpl extends Object implements ServerPreConnectEvent
This event is fired before the player connects to a server.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.velocitypowered.api.event.ResultedEvent
ResultedEvent.ComponentResult, ResultedEvent.GenericResult, ResultedEvent.Result
-
Nested classes/interfaces inherited from interface com.velocitypowered.api.event.player.ServerPreConnectEvent
ServerPreConnectEvent.ServerResult
-
-
Constructor Summary
Constructors Constructor Description ServerPreConnectEventImpl(Player player, RegisteredServer originalServer)Creates the ServerPreConnectEvent.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description RegisteredServeroriginalTarget()Returns the server that the player originally tried to connect to.Playerplayer()Returns the player connecting to the server.ServerPreConnectEvent.ServerResultresult()Returns the result associated with this event.voidsetResult(ServerPreConnectEvent.ServerResult result)Sets the result of this event.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.velocitypowered.api.event.player.ServerPreConnectEvent
reject
-
-
-
-
Constructor Detail
-
ServerPreConnectEventImpl
public ServerPreConnectEventImpl(Player player, RegisteredServer originalServer)
Creates the ServerPreConnectEvent.- Parameters:
player- the player who is connecting to a serveroriginalServer- the server the player was trying to connect to
-
-
Method Detail
-
player
public Player player()
Returns the player connecting to the server.- Specified by:
playerin interfaceServerPreConnectEvent- Returns:
- the player connecting to the server
-
result
public ServerPreConnectEvent.ServerResult result()
Description copied from interface:ResultedEventReturns the result associated with this event.- Specified by:
resultin interfaceResultedEvent<ServerPreConnectEvent.ServerResult>- Returns:
- the result of this event
-
setResult
public void setResult(ServerPreConnectEvent.ServerResult result)
Description copied from interface:ResultedEventSets the result of this event. The result must be non-null.- Specified by:
setResultin interfaceResultedEvent<ServerPreConnectEvent.ServerResult>- Parameters:
result- the new result
-
originalTarget
public RegisteredServer originalTarget()
Returns the server that the player originally tried to connect to. To get the server the player will connect to, see theServerPreConnectEvent.ServerResultof this event. To get the server the player is currently on when this event is fired, usePlayer.connectedServer().- Specified by:
originalTargetin interfaceServerPreConnectEvent- Returns:
- the server that the player originally tried to connect to
-
-