From 154b50992cb8becae054fec6f20bf5fd339d3e21 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Sat, 22 Aug 2020 13:36:34 -0400 Subject: [PATCH] Fix try list giving up after the first server. --- .../proxy/connection/client/ConnectedPlayer.java | 5 ++--- 1 file changed, 2 insertions(+), 3 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 9ec3ade7d..d3c2ff90d 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 @@ -576,6 +576,7 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player { } private void handleKickEvent(KickedFromServerEvent originalEvent, Component friendlyReason) { + boolean connectedToServer = connectedServer != null; server.getEventManager().fire(originalEvent) .thenAcceptAsync(event -> { // There can't be any connection in flight now. @@ -594,9 +595,7 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player { createConnectionRequest(res.getServer()) .connectWithIndication() .whenCompleteAsync((newResult, exception) -> { - if (newResult == null || !newResult) { - disconnect(friendlyReason); - } else { + if (newResult != null && newResult && connectedToServer) { if (res.getMessageComponent() == null) { sendMessage(server.getConfiguration().getMessages() .getMovedToNewServerPrefix().append(friendlyReason));