Source:
public void handle(Packet2Handshake handshake) throws Exception { Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" ); this.handshake = handshake; this.vHost = new InetSocketAddress( handshake.getHost(), handshake.getPort() ); bungee.getLogger().log( Level.INFO, "{0} has connected", this ); if ( handshake.getProtocolVersion() > Vanilla.PROTOCOL_VERSION ) { disconnect( bungee.getTranslation( "outdated_server" ) ); } else if ( handshake.getProtocolVersion() < Vanilla.PROTOCOL_VERSION ) { disconnect( bungee.getTranslation( "outdated_client" ) ); } if ( handshake.getUsername().length() > 16 ) { disconnect( "Cannot have username longer than 16 characters" ); return; } int limit = BungeeCord.getInstance().config.getPlayerLimit(); if ( limit > 0 && bungee.getOnlineCount() > limit ) { disconnect( bungee.getTranslation( "proxy_full" ) ); return; } if ( !isOnlineMode() && bungee.getPlayer( handshake.getUsername() ) != null ) { disconnect( bungee.getTranslation( "already_connected" ) ); return; } Callback<PlayerHandshakeEvent> complete = new Callback<PlayerHandshakeEvent>() { @Override public void done(PlayerHandshakeEvent result, Throwable error) { if ( result.isCancelled() ) { disconnect( result.getCancelReason() ); } if ( ch.isClosed() ) { return; } thisState = State.ENCRYPT; ch.getHandle().eventLoop().execute( new Runnable() { @Override public void run() { if ( ch.getHandle().isActive() ) { unsafe().sendPacket( PacketConstants.I_AM_BUNGEE ); unsafe().sendPacket( PacketConstants.FORGE_MOD_REQUEST ); unsafe().sendPacket( request = EncryptionUtil.encryptRequest( InitialHandler.this.onlineMode ) ); } } } ); } }; bungee.getPluginManager().callEvent( new PlayerHandshakeEvent( InitialHandler.this, handshake, complete ) ); }

Target:
public void handle(Packet2Handshake handshake) throws Exception { Preconditions.checkState( thisState == State.HANDSHAKE, "Not expecting HANDSHAKE" ); this.handshake = handshake; this.vHost = new InetSocketAddress( handshake.getHost(), handshake.getPort() ); bungee.getLogger().log( Level.INFO, "{0} has connected", this ); if ( handshake.getProtocolVersion() > Vanilla.PROTOCOL_VERSION ) { disconnect( bungee.getTranslation( "outdated_server" ) ); } else if ( handshake.getProtocolVersion() < Vanilla.PROTOCOL_VERSION ) { disconnect( bungee.getTranslation( "outdated_client" ) ); } if ( handshake.getUsername().length() > 16 ) { disconnect( "Cannot have username longer than 16 characters" ); return; } int limit = BungeeCord.getInstance().config.getPlayerLimit(); if ( limit > 0 && bungee.getOnlineCount() > limit ) { disconnect( bungee.getTranslation( "proxy_full" ) ); return; } if ( !isOnlineMode() && bungee.getPlayer( handshake.getUsername() ) != null ) { disconnect( bungee.getTranslation( "already_connected" ) ); return; } Callback<PlayerHandshakeEvent> complete = new Callback<PlayerHandshakeEvent>() { @Override public void done(PlayerHandshakeEvent result, Throwable error) { if ( result.isCancelled() ) { disconnect( result.getCancelReason() ); return; } thisState = State.ENCRYPT; ch.getHandle().eventLoop().execute( new Runnable() { @Override public void run() { if ( ch.getHandle().isActive() ) { unsafe().sendPacket( PacketConstants.I_AM_BUNGEE ); unsafe().sendPacket( PacketConstants.FORGE_MOD_REQUEST ); unsafe().sendPacket( request = EncryptionUtil.encryptRequest( InitialHandler.this.onlineMode ) ); } } } ); } }; bungee.getPluginManager().callEvent( new PlayerHandshakeEvent( InitialHandler.this, handshake, complete ) ); }