ProtocolLib

3M Downloads

DecoderException while trying to create a PacketPlayOutScoreboardTeam in 1.19

diogotcorreia opened this issue · 4 comments

commented
  • This issue is not solved in a development build

Describe the bug
When creating a PacketPlayOutScoreboardTeam packet using ProtocolLib, the following exception is thrown:

Stack trace
[16:41:29] [Craft Scheduler Thread - 0/WARN]: [Triton] Plugin Triton v3.8.1-SNAPSHOT generated an exception while executing task 139
java.lang.IllegalArgumentException: Unable to create packet class net.minecraft.network.protocol.game.PacketPlayOutScoreboardTeam
        at com.comphenix.protocol.injector.StructureCache.lambda$newPacket$0(StructureCache.java:80) ~[?:?]
        at com.comphenix.protocol.injector.StructureCache.newPacket(StructureCache.java:85) ~[?:?]
        at com.comphenix.protocol.injector.StructureCache.newPacket(StructureCache.java:98) ~[?:?]
        at com.comphenix.protocol.events.PacketContainer.<init>(PacketContainer.java:113) ~[?:?]
        at com.comphenix.protocol.injector.PacketFilterManager.createPacket(PacketFilterManager.java:384) ~[?:?]
        at com.comphenix.protocol.injector.PacketFilterManager.createPacket(PacketFilterManager.java:379) ~[?:?]
        at com.rexcantor64.triton.packetinterceptor.ProtocolLibListener.lambda$refreshScoreboard$5(ProtocolLibListener.java:742) ~[?:?]
        at java.util.concurrent.ConcurrentHashMap.forEach(ConcurrentHashMap.java:1603) ~[?:?]
        at com.rexcantor64.triton.packetinterceptor.ProtocolLibListener.refreshScoreboard(ProtocolLibListener.java:740) ~[?:?]
        at com.rexcantor64.triton.player.SpigotLanguagePlayer.lambda$refreshAll$2(SpigotLanguagePlayer.java:147) ~[?:?]
        at java.util.Optional.ifPresent(Optional.java:178) ~[?:?]
        at com.rexcantor64.triton.player.SpigotLanguagePlayer.lambda$refreshAll$3(SpigotLanguagePlayer.java:140) ~[?:?]
        at java.util.Optional.ifPresent(Optional.java:178) ~[?:?]
        at com.rexcantor64.triton.player.SpigotLanguagePlayer.lambda$refreshAll$4(SpigotLanguagePlayer.java:136) ~[?:?]
        at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftTask.run(CraftTask.java:82) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3551-Spigot-14a2382-9a8e080]
        at org.bukkit.craftbukkit.v1_19_R1.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) [spigot-1.19-R0.1-SNAPSHOT.jar:3551-Spigot-14a2382-9a8e080]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
        at java.lang.Thread.run(Thread.java:833) [?:?]
Caused by: java.lang.RuntimeException: An internal error occured.
        at com.comphenix.protocol.reflect.accessors.DefaultConstrutorAccessor.invoke(DefaultConstrutorAccessor.java:22) ~[?:?]
        at com.comphenix.protocol.injector.StructureCache.lambda$newPacket$0(StructureCache.java:72) ~[?:?]
        ... 18 more
Caused by: io.netty.handler.codec.DecoderException: Received unexpected null component
        at net.minecraft.network.PacketDataSerializer.j(PacketDataSerializer.java:431) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3551-Spigot-14a2382-9a8e080]
        at net.minecraft.network.protocol.game.PacketPlayOutScoreboardTeam$b.<init>(SourceFile:170) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3551-Spigot-14a2382-9a8e080]
        at net.minecraft.network.protocol.game.PacketPlayOutScoreboardTeam.<init>(SourceFile:68) ~[spigot-1.19-R0.1-SNAPSHOT.jar:3551-Spigot-14a2382-9a8e080]
        at jdk.internal.reflect.DirectConstructorHandleAccessor.newInstance(DirectConstructorHandleAccessor.java:67) ~[?:?]
        at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[?:?]
        at java.lang.reflect.Constructor.newInstance(Constructor.java:483) ~[?:?]
        at com.comphenix.protocol.reflect.accessors.DefaultConstrutorAccessor.invoke(DefaultConstrutorAccessor.java:16) ~[?:?]
        at com.comphenix.protocol.injector.StructureCache.lambda$newPacket$0(StructureCache.java:72) ~[?:?]
        ... 18 more

Related code (line numbers are not accurate because the stack trace is from unpushed code):
https://github.com/tritonmc/Triton/blob/b338c419807c20e2c383946e6094a3fe73dcb2bf/core/src/main/java/com/rexcantor64/triton/packetinterceptor/ProtocolLibListener.java#L739

To Reproduce
Steps to reproduce the behavior:

  1. Using latest Spigot build (3551-Spigot-14a2382-9a8e080 (MC: 1.19) (Implementing API version 1.19-R0.1-SNAPSHOT)), run the following code:
    ProtocolLibrary.getProtocolManager().createPacket(PacketType.Play.Server.SCOREBOARD_TEAM);

Expected behavior
The packet should be created without an exception, like in previous MC versions.

Screenshots
not applicable

Version Info
https://pastebin.com/etGV3Qd4

ProtocolLib 5.0.0-b577

Additional context
Looking at the decompiled server code, it seems like the error is thrown while trying to decode an IChatBaseComponent from a PacketDataSerializer.

commented

I cannot reproduce this 🤔

commented

Hm that's interesting
I'll see if I can make a simple plugin that reproduces this then

commented

Currently having issues with this too :)

commented

This doesn't seem to happen anymore 🤔

Closing for now, will reopen if it happens again