PacketType.Play.Server.ENTITY_METADATA bug
TomTeDev opened this issue ยท 4 comments
Im using latest dev build -> Revision: 365bb66
Error stacktrace:
[18:44:26 ERROR]: [OGFactions] Unhandled exception number 128 occurred in onPacketSending(PacketEvent) for OGFactions
java.lang.IllegalArgumentException: Unrecognized type class net.minecraft.network.syncher.DataWatcher$b
at com.comphenix.protocol.wrappers.BukkitConverters$8.getSpecific(BukkitConverters.java:639) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.wrappers.BukkitConverters$8.getSpecific(BukkitConverters.java:626) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.wrappers.Converters$1.getSpecific(Converters.java:50) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.wrappers.BukkitConverters.getSpecificList(BukkitConverters.java:321) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.wrappers.BukkitConverters.access$000(BukkitConverters.java:91) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.wrappers.BukkitConverters$3.getSpecific(BukkitConverters.java:365) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.wrappers.BukkitConverters$3.getSpecific(BukkitConverters.java:362) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.wrappers.Converters$1.getSpecific(Converters.java:50) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.reflect.StructureModifier.readInternal(StructureModifier.java:301) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.reflect.StructureModifier.read(StructureModifier.java:251) ~[ProtocolLib.jar:?]
at mucho.more.OGFactions$3.onPacketSending(OGFactions.java:494) ~[Factions-1.0.jar:?]
at com.comphenix.protocol.injector.SortedPacketListenerList.invokeSendingListener(SortedPacketListenerList.java:195) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.SortedPacketListenerList.invokePacketSending(SortedPacketListenerList.java:149) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.PacketFilterManager.postPacketToListeners(PacketFilterManager.java:547) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.PacketFilterManager.invokePacketSending(PacketFilterManager.java:521) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.netty.manager.NetworkManagerInjector.onPacketSending(NetworkManagerInjector.java:99) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.netty.channel.NettyChannelInjector.processOutbound(NettyChannelInjector.java:571) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.netty.channel.NettyChannelInjector$2.doProxyRunnable(NettyChannelInjector.java:472) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.netty.channel.NettyEventLoopProxy.proxyRunnable(NettyEventLoopProxy.java:43) ~[ProtocolLib.jar:?]
at com.comphenix.protocol.injector.netty.channel.NettyEventLoopProxy.execute(NettyEventLoopProxy.java:252) ~[ProtocolLib.jar:?]
at net.minecraft.network.Connection.sendPacket(Connection.java:430) ~[?:?]
at net.minecraft.network.Connection.processQueue(Connection.java:547) ~[?:?]
at net.minecraft.network.Connection.flushQueue(Connection.java:503) ~[?:?]
at net.minecraft.network.Connection.send(Connection.java:398) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.send(ServerGamePacketListenerImpl.java:2248) ~[?:?]
at net.minecraft.server.network.ServerGamePacketListenerImpl.send(ServerGamePacketListenerImpl.java:2234) ~[?:?]
at net.minecraft.server.level.ChunkMap$TrackedEntity.broadcast(ChunkMap.java:1562) ~[?:?]
at net.minecraft.server.level.ServerEntity.sendChanges(ServerEntity.java:197) ~[?:?]
at net.minecraft.server.level.ChunkMap.processTrackQueue(ChunkMap.java:1267) ~[purpur-1.19.3.jar:git-Purpur-1913]
at net.minecraft.server.level.ChunkMap.tick(ChunkMap.java:1278) ~[purpur-1.19.3.jar:git-Purpur-1913]
at net.minecraft.server.level.ServerChunkCache.tickChunks(ServerChunkCache.java:829) ~[?:?]
at net.minecraft.server.level.ServerChunkCache.tick(ServerChunkCache.java:652) ~[?:?]
at net.minecraft.server.level.ServerLevel.tick(ServerLevel.java:707) ~[?:?]
at net.minecraft.server.MinecraftServer.tickChildren(MinecraftServer.java:1564) ~[purpur-1.19.3.jar:git-Purpur-1913]
at net.minecraft.server.dedicated.DedicatedServer.tickChildren(DedicatedServer.java:488) ~[purpur-1.19.3.jar:git-Purpur-1913]
at net.minecraft.server.MinecraftServer.tickServer(MinecraftServer.java:1424) ~[purpur-1.19.3.jar:git-Purpur-1913]
at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1194) ~[purpur-1.19.3.jar:git-Purpur-1913]
at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:321) ~[purpur-1.19.3.jar:git-Purpur-1913]
at java.lang.Thread.run(Thread.java:833) ~[?:?]
To Reproduce
Steps to reproduce the behavior:
Use that code:
ProtocolLibrary.getProtocolManager().addPacketListener(new PacketAdapter(plugin, PacketType.Play.Server.ENTITY_METADATA) {
@OverRide
public void onPacketSending(PacketEvent event) {
PacketContainer packet = event.getPacket();
Player player = event.getPlayer();
StructureModifier integerStructureModifier = packet.getIntegers();
if (integerStructureModifier.size() != 1) return;
StructureModifier<List> watchableModifier = packet.getWatchableCollectionModifier();
if (watchableModifier.size() != 1) return;
List watchableObjectList = watchableModifier.read(0);
}
}
Expected behavior
I was trying to change hologram displaynames (different for every player) *was working just fine on 1.19.2 minecraft +4.8.0 protocollib
Use these plugin builds. 4.8.0 was created for versions 1.8 - 1.18. Because your server core version is 1.19.[2] here is the link for your version: https://ci.dmulloy2.net/job/ProtocolLib/606/
Same error with version you have recomended, as well as the latest build (which i tried in the first place). Server is running on 1.19.3 paper
Use these plugin builds. 4.8.0 was created for versions 1.8 - 1.18. Because your server core version is 1.19.[2] here is the link for your version: https://ci.dmulloy2.net/job/ProtocolLib/606/
@dmulloy2 will it be fixed soon?
It looks like you have to use container.getDataValueCollectionModifier()
instead of container.getWatchableCollectionModifier()
.
See #2032 for more info.