From 72d47b5a3dd703659c15d4594747e728ae4241aa Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Thu, 18 Feb 2021 18:12:38 -0500 Subject: [PATCH] Don't advertise the BungeeCord plugin messaging channel if it is disabled. --- .../connection/backend/BackendPlaySessionHandler.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) 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 667b1867e..b396799dc 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 @@ -65,10 +65,13 @@ public class BackendPlaySessionHandler implements MinecraftSessionHandler { @Override public void activated() { serverConn.getServer().addPlayer(serverConn.getPlayer()); - MinecraftConnection serverMc = serverConn.ensureConnected(); - serverMc.write(PluginMessageUtil.constructChannelsPacket(serverMc.getProtocolVersion(), - ImmutableList.of(getBungeeCordChannel(serverMc.getProtocolVersion())) - )); + + if (server.getConfiguration().isBungeePluginChannelEnabled()) { + MinecraftConnection serverMc = serverConn.ensureConnected(); + serverMc.write(PluginMessageUtil.constructChannelsPacket(serverMc.getProtocolVersion(), + ImmutableList.of(getBungeeCordChannel(serverMc.getProtocolVersion())) + )); + } } @Override