Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-12-23 23:00:35 +01:00
Merge branch 'dev/1.1.0' into decode-multiple
Dieser Commit ist enthalten in:
Commit
a15c8ecc2b
@ -10,19 +10,31 @@ import com.velocitypowered.api.proxy.Player;
|
||||
public final class DisconnectEvent {
|
||||
|
||||
private final Player player;
|
||||
private final boolean disconnectedDuringLogin;
|
||||
|
||||
public DisconnectEvent(Player player) {
|
||||
this(player, false);
|
||||
}
|
||||
|
||||
public DisconnectEvent(Player player,
|
||||
boolean disconnectedDuringLogin) {
|
||||
this.player = Preconditions.checkNotNull(player, "player");
|
||||
this.disconnectedDuringLogin = disconnectedDuringLogin;
|
||||
}
|
||||
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
|
||||
public boolean disconnectedDuringLogin() {
|
||||
return this.disconnectedDuringLogin;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "DisconnectEvent{"
|
||||
+ "player=" + player
|
||||
+ "player=" + player + ", "
|
||||
+ "disconnectedDuringLogin=" + disconnectedDuringLogin
|
||||
+ '}';
|
||||
}
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren