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 cf935ff41..bdf494fc1 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 @@ -65,7 +65,7 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler { @Override public void activated() { PluginMessage register = PluginMessageUtil.constructChannelsPacket(player.getProtocolVersion(), - server.getChannelRegistrar().getModernChannelIds()); + server.getChannelRegistrar().getChannelsForProtocol(player.getProtocolVersion())); player.getConnection().write(register); } diff --git a/proxy/src/main/java/com/velocitypowered/proxy/util/VelocityChannelRegistrar.java b/proxy/src/main/java/com/velocitypowered/proxy/util/VelocityChannelRegistrar.java index a5ab624b8..abf47bf30 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/util/VelocityChannelRegistrar.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/util/VelocityChannelRegistrar.java @@ -6,6 +6,7 @@ import com.velocitypowered.api.proxy.messages.ChannelIdentifier; import com.velocitypowered.api.proxy.messages.ChannelRegistrar; import com.velocitypowered.api.proxy.messages.LegacyChannelIdentifier; import com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier; +import com.velocitypowered.proxy.protocol.ProtocolConstants; import java.util.ArrayList; import java.util.Collection; import java.util.Map; @@ -68,4 +69,11 @@ public class VelocityChannelRegistrar implements ChannelRegistrar { public @Nullable ChannelIdentifier getFromId(String id) { return identifierMap.get(id); } + + public Collection getChannelsForProtocol(int protocolVersion) { + if (protocolVersion >= ProtocolConstants.MINECRAFT_1_13) { + return getModernChannelIds(); + } + return getIdsForLegacyConnections(); + } }