mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-09 18:08:37 +01:00
Fix player not being directly disconnected after a kick
This commit is contained in:
parent
4f2ec0a65f
commit
509f8f7851
@ -4,7 +4,6 @@ import com.google.common.collect.Queues;
|
||||
import net.minestom.server.MinecraftServer;
|
||||
import net.minestom.server.advancements.AdvancementTab;
|
||||
import net.minestom.server.attribute.Attribute;
|
||||
import net.minestom.server.attribute.AttributeInstance;
|
||||
import net.minestom.server.bossbar.BossBar;
|
||||
import net.minestom.server.chat.ChatParser;
|
||||
import net.minestom.server.chat.ColoredText;
|
||||
@ -1726,9 +1725,14 @@ public class Player extends LivingEntity implements CommandSender {
|
||||
disconnectPacket = new DisconnectPacket(text);
|
||||
}
|
||||
|
||||
if (playerConnection instanceof NettyPlayerConnection) {
|
||||
((NettyPlayerConnection) playerConnection).writeAndFlush(disconnectPacket);
|
||||
playerConnection.disconnect();
|
||||
} else {
|
||||
playerConnection.sendPacket(disconnectPacket);
|
||||
playerConnection.refreshOnline(false);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Kicks the player with a reason.
|
||||
|
Loading…
Reference in New Issue
Block a user