From d28022ab60106cca159bba44b724bf1a617b1400 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Thu, 27 Aug 2020 15:24:48 -0400 Subject: [PATCH] Move connectedServer clearing check to be done later. --- .../proxy/connection/client/ConnectedPlayer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 cfc33f8e2..596c36c3c 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 @@ -564,8 +564,6 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player { Optional next = getNextServerToTry(rs); result = next.map(RedirectPlayer::create) .orElseGet(() -> DisconnectPlayer.create(friendlyReason)); - // Make sure we clear the current connected server as the connection is invalid. - connectedServer = null; } else { // If we were kicked by going to another server, the connection should not be in flight if (connectionInFlight != null && connectionInFlight.getServer().equals(rs)) { @@ -583,6 +581,8 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player { .thenAcceptAsync(event -> { // There can't be any connection in flight now. connectionInFlight = null; + // Make sure we clear the current connected server as the connection is invalid. + connectedServer = null; if (!isActive()) { // If the connection is no longer active, it makes no sense to try and recover it.