From e9568e1b6c27764a320bd6d2d708e4a017251503 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Fri, 14 Sep 2018 15:26:51 -0400 Subject: [PATCH] Do not write plugin messages from the server if the player hasn't joined --- .../connection/client/ClientPlaySessionHandler.java | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientPlaySessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientPlaySessionHandler.java index 295b4b131..f550865d2 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientPlaySessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientPlaySessionHandler.java @@ -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); } }