mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-24 09:01:54 +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.MinecraftServer;
|
||||||
import net.minestom.server.advancements.AdvancementTab;
|
import net.minestom.server.advancements.AdvancementTab;
|
||||||
import net.minestom.server.attribute.Attribute;
|
import net.minestom.server.attribute.Attribute;
|
||||||
import net.minestom.server.attribute.AttributeInstance;
|
|
||||||
import net.minestom.server.bossbar.BossBar;
|
import net.minestom.server.bossbar.BossBar;
|
||||||
import net.minestom.server.chat.ChatParser;
|
import net.minestom.server.chat.ChatParser;
|
||||||
import net.minestom.server.chat.ColoredText;
|
import net.minestom.server.chat.ColoredText;
|
||||||
@ -1726,8 +1725,13 @@ public class Player extends LivingEntity implements CommandSender {
|
|||||||
disconnectPacket = new DisconnectPacket(text);
|
disconnectPacket = new DisconnectPacket(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
playerConnection.sendPacket(disconnectPacket);
|
if (playerConnection instanceof NettyPlayerConnection) {
|
||||||
playerConnection.refreshOnline(false);
|
((NettyPlayerConnection) playerConnection).writeAndFlush(disconnectPacket);
|
||||||
|
playerConnection.disconnect();
|
||||||
|
} else {
|
||||||
|
playerConnection.sendPacket(disconnectPacket);
|
||||||
|
playerConnection.refreshOnline(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user