diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/BackendPlaySessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/BackendPlaySessionHandler.java index 5a42d2922..c21ae6ecd 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/BackendPlaySessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/backend/BackendPlaySessionHandler.java @@ -18,7 +18,6 @@ package com.velocitypowered.proxy.connection.backend; import static com.velocitypowered.proxy.connection.backend.BungeeCordMessageResponder.getBungeeCordChannel; -import static com.velocitypowered.proxy.protocol.util.PluginMessageUtil.constructChannelsPacket; import com.google.common.base.Preconditions; import com.google.common.collect.ImmutableList; @@ -62,8 +61,6 @@ import io.netty.buffer.ByteBufUtil; import io.netty.buffer.Unpooled; import io.netty.channel.Channel; import io.netty.handler.timeout.ReadTimeoutException; - -import java.util.Collection; import java.util.regex.Pattern; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -115,13 +112,6 @@ public class BackendPlaySessionHandler implements MinecraftSessionHandler { )); } - Collection channels = - server.getChannelRegistrar().getChannelsForProtocol(serverConn.getPlayer().getProtocolVersion()); - if (!channels.isEmpty()) { - PluginMessage register = constructChannelsPacket(serverConn.getPlayer().getProtocolVersion(), channels); - serverMc.write(register); - } - } @Override 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 d2da3aa8e..304fbbaae 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 @@ -535,6 +535,14 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler { } serverBossBars.clear(); + // Tell the server about the proxy's plugin message channels. + ProtocolVersion serverVersion = serverMc.getProtocolVersion(); + final Collection channels = server.getChannelRegistrar() + .getChannelsForProtocol(serverMc.getProtocolVersion()); + if (!channels.isEmpty()) { + serverMc.delayedWrite(constructChannelsPacket(serverVersion, channels)); + } + // If we had plugin messages queued during login/FML handshake, send them now. PluginMessage pm; while ((pm = loginPluginMessages.poll()) != null) {