diff --git a/src/main/java/net/md_5/bungee/InitialHandler.java b/src/main/java/net/md_5/bungee/InitialHandler.java index 974a77c0..785de47d 100644 --- a/src/main/java/net/md_5/bungee/InitialHandler.java +++ b/src/main/java/net/md_5/bungee/InitialHandler.java @@ -39,7 +39,7 @@ public class InitialHandler implements Runnable case 0x02: Packet2Handshake handshake = new Packet2Handshake(packet); // fire connect event - LoginEvent event = new LoginEvent(handshake.username, socket.getInetAddress()); + LoginEvent event = new LoginEvent(handshake.username, socket.getInetAddress(), handshake.host); BungeeCord.instance.pluginManager.onHandshake(event); if (event.isCancelled()) { diff --git a/src/main/java/net/md_5/bungee/plugin/LoginEvent.java b/src/main/java/net/md_5/bungee/plugin/LoginEvent.java index 518cbfae..16479c84 100644 --- a/src/main/java/net/md_5/bungee/plugin/LoginEvent.java +++ b/src/main/java/net/md_5/bungee/plugin/LoginEvent.java @@ -26,4 +26,8 @@ public class LoginEvent implements Cancellable * IP address of the remote connection. */ private final InetAddress address; + /** + * Hostname which the user tried to connect to. + */ + private final String hostname; }