From 496c579e469e5ba13e26c98bf8ae8bc7ee2a5113 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Fri, 14 Sep 2018 13:56:38 -0400 Subject: [PATCH] Drop non-FML handshake packets if the game start process is not done. --- .../proxy/connection/client/ClientPlaySessionHandler.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 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 6bc44a2b0..353c2d0c4 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 @@ -278,8 +278,11 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler { } if (player.getConnectedServer().isLegacyForge() && !player.getConnectedServer().hasCompletedJoin()) { - // Ensure that the messages are forwarded - player.getConnectedServer().getMinecraftConnection().write(packet); + // Ensure that the FML handshake is forwarded. Do not try to forward other client-side plugin messages, as + // some mods are poorly coded and will crash if mod packets are sent during the handshake/join game process. + if (packet.getChannel().equals(VelocityConstants.FORGE_LEGACY_HANDSHAKE_CHANNEL)) { + player.getConnectedServer().getMinecraftConnection().write(packet); + } return; }