diff --git a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java index 8283286563..90c5237cad 100644 --- a/proxy/src/main/java/net/md_5/bungee/ServerConnector.java +++ b/proxy/src/main/java/net/md_5/bungee/ServerConnector.java @@ -361,7 +361,10 @@ private void cutThrough(ServerConnection server) if ( user.getServer() != null ) { // Begin config mode - user.unsafe().sendPacket( new StartConfiguration() ); + if ( user.getCh().getEncodeProtocol() != Protocol.CONFIGURATION ) + { + user.unsafe().sendPacket( new StartConfiguration() ); + } } else { LoginResult loginProfile = user.getPendingConnection().getLoginProfile(); diff --git a/proxy/src/main/java/net/md_5/bungee/UserConnection.java b/proxy/src/main/java/net/md_5/bungee/UserConnection.java index 54842ca0ee..2359e86472 100644 --- a/proxy/src/main/java/net/md_5/bungee/UserConnection.java +++ b/proxy/src/main/java/net/md_5/bungee/UserConnection.java @@ -306,6 +306,11 @@ public void connect(final ServerConnectRequest request) { Preconditions.checkNotNull( request, "request" ); + ch.getHandle().eventLoop().execute( () -> connect0( request ) ); + } + + private void connect0(final ServerConnectRequest request) + { final Callback callback = request.getCallback(); ServerConnectEvent event = new ServerConnectEvent( this, request.getTarget(), request.getReason(), request ); if ( bungee.getPluginManager().callEvent( event ).isCancelled() ) @@ -315,10 +320,6 @@ public void connect(final ServerConnectRequest request) callback.done( ServerConnectRequest.Result.EVENT_CANCEL, null ); } - if ( getServer() == null && !ch.isClosing() ) - { - throw new IllegalStateException( "Cancelled ServerConnectEvent with no server or disconnect." ); - } return; }