From edfdcf3d53407f9bdd1255c1be97f0d9c5d050b3 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Sun, 25 Nov 2018 14:54:03 -0500 Subject: [PATCH] Document ServerPreConnectEvent more carefully. --- .../api/event/player/ServerPreConnectEvent.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/api/src/main/java/com/velocitypowered/api/event/player/ServerPreConnectEvent.java b/api/src/main/java/com/velocitypowered/api/event/player/ServerPreConnectEvent.java index 12a989022..2bcb10bd6 100644 --- a/api/src/main/java/com/velocitypowered/api/event/player/ServerPreConnectEvent.java +++ b/api/src/main/java/com/velocitypowered/api/event/player/ServerPreConnectEvent.java @@ -30,6 +30,10 @@ public final class ServerPreConnectEvent implements this.result = ServerResult.allowed(originalServer); } + /** + * Returns the player connecting to the server. + * @return the player connecting to the server + */ public Player getPlayer() { return player; } @@ -44,6 +48,12 @@ public final class ServerPreConnectEvent implements this.result = Preconditions.checkNotNull(result, "result"); } + /** + * Returns the server that the player originally tried to connect to. To get the server the + * player will connect to, see the {@link ServerResult} of this event. To get the server the + * player is currently on when this event is fired, use {@link Player#getCurrentServer()}. + * @return the server that the player originally tried to connect to + */ public RegisteredServer getOriginalServer() { return originalServer; }