Fix issues with server connections.

This commit is contained in:
Andrew Steinborn
2018-10-29 19:25:51 -04:00
parent 2b53d14461
commit f423169449
3 changed files with 11 additions and 12 deletions

View File

@@ -324,7 +324,8 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
joinGame.getLevelType()));
}
// Remove old boss bars. These don't get cleared when sending JoinGame so we need to track these.
// Remove previous boss bars. These don't get cleared when sending JoinGame, thus the need to
// track them.
for (UUID serverBossBar : serverBossBars) {
BossBar deletePacket = new BossBar();
deletePacket.setUuid(serverBossBar);

View File

@@ -350,11 +350,9 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
} else {
connection.closeWith(Disconnect.create(friendlyReason));
}
} else if (kickReason != null) {
// Already connected to the server being disconnected from.
} else {
KickedFromServerEvent originalEvent = new KickedFromServerEvent(this, rs, kickReason,
!connectedServer.getServer().equals(rs), friendlyReason);
server.getEventManager().fire(originalEvent)
.thenAcceptAsync(event -> {
if (event.getResult() instanceof DisconnectPlayer) {
@@ -375,8 +373,6 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
connection.closeWith(Disconnect.create(friendlyReason));
}
}, connection.eventLoop());
} else {
connection.closeWith(Disconnect.create(friendlyReason));
}
}