mirror of
https://github.com/PaperMC/Velocity.git
synced 2025-03-07 15:57:17 +08:00
Do not write plugin messages from the server if the player hasn't joined
This commit is contained in:
parent
9776675b70
commit
e9568e1b6c
@ -300,18 +300,7 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
|
||||
MessageHandler.ForwardStatus status = server.getChannelRegistrar().handlePluginMessage(player,
|
||||
ChannelSide.FROM_CLIENT, packet);
|
||||
if (status == MessageHandler.ForwardStatus.FORWARD) {
|
||||
String channel = packet.getChannel();
|
||||
|
||||
// We're going to forward on the original packet.
|
||||
//
|
||||
// If we have Forge messages, we may need to drop them if the server switch has
|
||||
// not completed yet.
|
||||
if (channel.equals(VelocityConstants.FORGE_LEGACY_CHANNEL)
|
||||
|| channel.equals(VelocityConstants.FORGE_MULTIPART_LEGACY_CHANNEL)) {
|
||||
player.getConnectedServer().writeIfJoined(packet);
|
||||
} else {
|
||||
player.getConnectedServer().getMinecraftConnection().write(packet);
|
||||
}
|
||||
player.getConnectedServer().writeIfJoined(packet);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user