mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-14 12:11:27 +01:00
Fix Player#kick ignoring the kicking text
This commit is contained in:
parent
0a0d19128c
commit
47447706b0
@ -1743,7 +1743,6 @@ public class Player extends LivingEntity implements CommandSender {
|
||||
DisconnectPacket disconnectPacket = new DisconnectPacket();
|
||||
disconnectPacket.message = text;
|
||||
playerConnection.sendPacket(disconnectPacket);
|
||||
playerConnection.disconnect();
|
||||
playerConnection.refreshOnline(false);
|
||||
}
|
||||
|
||||
|
@ -56,6 +56,12 @@ public final class PacketProcessor {
|
||||
channel, c -> new NettyPlayerConnection((SocketChannel) channel.channel())
|
||||
);
|
||||
|
||||
// Prevent the client from sending packets when disconnected (kick)
|
||||
if (!playerConnection.isOnline()) {
|
||||
playerConnection.disconnect();
|
||||
return;
|
||||
}
|
||||
|
||||
if (MinecraftServer.getRateLimit() > 0)
|
||||
playerConnection.getPacketCounter().incrementAndGet();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user