diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/TransitionSessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/TransitionSessionHandler.java index ff3f56026..f127abe25 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/TransitionSessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/TransitionSessionHandler.java @@ -86,7 +86,7 @@ public class TransitionSessionHandler implements MinecraftSessionHandler { server.getEventManager() .fire(new ServerConnectedEvent(player, serverConn.getServer(), existingConnection != null ? existingConnection.getServer() : null)) - .whenCompleteAsync((x, error) -> { + .thenRunAsync(() -> { // Make sure we can still transition (player might have disconnected here). if (!serverConn.isActive()) { // Connection is obsolete. diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java index 949243e17..3cc40dfcb 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ConnectedPlayer.java @@ -1000,8 +1000,10 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player { VelocityServerConnection con = new VelocityServerConnection(vrs, ConnectedPlayer.this, server); connectionInFlight = con; - return con.connect().whenCompleteAsync((result, throwable) -> - this.resetIfInFlightIs(con), connection.eventLoop()); + return con.connect().thenApplyAsync((result) -> { + this.resetIfInFlightIs(con); + return result; + }, connection.eventLoop()); }, connection.eventLoop()); }); } @@ -1019,8 +1021,12 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player { if (status != null && !status.isSuccessful()) { if (!status.isSafe()) { handleConnectionException(status.getAttemptedConnection(), throwable, false); + return; } } + if (throwable != null) { + logger.error("Exception during connect; status = {}", status, throwable); + } }, connection.eventLoop()) .thenApply(x -> x); } diff --git a/proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/GS4QueryHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/GS4QueryHandler.java index ffe2a24b4..287de50aa 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/GS4QueryHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/protocol/netty/GS4QueryHandler.java @@ -134,7 +134,7 @@ public class GS4QueryHandler extends SimpleChannelInboundHandler // Call event and write response server.getEventManager() .fire(new ProxyQueryEvent(isBasic ? BASIC : FULL, senderAddress, response)) - .whenCompleteAsync((event, exc) -> { + .thenAcceptAsync((event) -> { // Packet header ByteBuf queryResponse = ctx.alloc().buffer(); queryResponse.writeByte(QUERY_TYPE_STAT);