Add DisconnectEvent#disconnectedDuringLogin()

This commit is contained in:
Andrew Steinborn
2019-12-24 23:56:39 -05:00
parent 4c09024952
commit fb0446f4fc
2 changed files with 16 additions and 2 deletions

View File

@@ -571,8 +571,10 @@ public class ConnectedPlayer implements MinecraftConnectionAssociation, Player {
if (connectedServer != null) {
connectedServer.disconnect();
}
boolean isConnected = server.getPlayer(this.getUniqueId()).isPresent();
server.unregisterConnection(this);
server.getEventManager().fire(new DisconnectEvent(this))
server.getEventManager().fire(new DisconnectEvent(this, !isConnected))
.thenRun(() -> this.teardownFuture.complete(null));
}