SpigotMC / BungeeCord

BungeeCord, the 6th in a generation of server portal suites. Efficiently proxies and maintains connections and transport between multiple Minecraft servers.
https://www.spigotmc.org/go/bungeecord
Other
1.57k stars 1.1k forks source link

Error connecting to a 1.8 server #3317

Closed Random4User closed 2 years ago

Random4User commented 2 years ago

When I try to connect to a 1.8 server with a 1.19 client, the following error occurs. The server has the latest ViaVersion version (4.3.1) I use the latest bungeecord version

Error:

io.netty.handler.codec.EncoderException: java.lang.IllegalArgumentException: Cannot get ID for packet class net.md_5.bungee.protocol.packet.Chat in phase GAME with direction TO_CLIENT
        at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:125)
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:717)
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:709)
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:792)
        at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:702)
        at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:110)
        at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:717)
        at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:764)
        at io.netty.channel.AbstractChannelHandlerContext$WriteTask.run(AbstractChannelHandlerContext.java:1071)
        at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
        at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
        at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
        at io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:391)
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:995)
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
        at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalArgumentException: Cannot get ID for packet class net.md_5.bungee.protocol.packet.Chat in phase GAME with direction TO_CLIENT
        at com.google.common.base.Preconditions.checkArgument(Preconditions.java:453)
        at net.md_5.bungee.protocol.Protocol$DirectionData.getId(Protocol.java:628)
        at net.md_5.bungee.protocol.MinecraftEncoder.encode(MinecraftEncoder.java:23)
        at net.md_5.bungee.protocol.MinecraftEncoder.encode(MinecraftEncoder.java:9)
        at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107)
        ... 15 more
md-5 commented 2 years ago

Latest is not a version, viaversion is unsupoorted

WesternIcelander commented 2 years ago

The problem is not with BungeeCord or with ViaVersion.

You have a plugin on BungeeCord that is doing something like this:

player.unsafe().sendPacket(new Chat(message));

Chat is not a valid packet on 1.19, it was split into PlayerChat and SystemChat. Try to avoid using unsafe() from now on! :P