Fix try list giving up after the first server.

This commit is contained in:
Andrew Steinborn
2020-08-22 13:36:34 -04:00
parent 1f621300f6
commit 154b50992c

View File

@@ -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));