WrappedDataWatcher constructor NPE
unldenis opened this issue ยท 1 comments
- This issue is not solved in a development build
ProtocolLib is launching a NPE because does not find a constructor when creating a WrappedDataWatcher() in Paper 1.19.4.
More info here.
Logs:
[19:45:02] [Craft Scheduler Thread - 3 - Parcour/WARN]: [Parcour] Plugin Parcour v1.0.0-RELEASE generated an exception while executing task 22 java.lang.NullPointerException: constructor at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:907) ~[guava-31.1-jre.jar:?] at com.comphenix.protocol.reflect.accessors.MethodHandleHelper.getConstructorAccessor(MethodHandleHelper.java:70) ~[ProtocolLib.jar:?] at com.comphenix.protocol.reflect.accessors.Accessors.getConstructorAccessor(Accessors.java:167) ~[ProtocolLib.jar:?] at com.comphenix.protocol.reflect.accessors.Accessors.getConstructorAccessor(Accessors.java:145) ~[ProtocolLib.jar:?] at com.comphenix.protocol.wrappers.LegacyDataWatcher.newHandle(LegacyDataWatcher.java:113) ~[ProtocolLib.jar:?] at com.comphenix.protocol.wrappers.LegacyDataWatcher.<init>(LegacyDataWatcher.java:108) ~[ProtocolLib.jar:?] at com.comphenix.protocol.wrappers.LegacyDataWatcher.<init>(LegacyDataWatcher.java:85) ~[ProtocolLib.jar:?] at com.comphenix.protocol.wrappers.WrappedDataWatcher.<init>(WrappedDataWatcher.java:86) ~[ProtocolLib.jar:?] at org.holoeasy.packet.metadata.text.MetadataTextPacketD.metadata(MetadataTextPacketD.kt:18) ~[parcour-1.0.0-RELEASE.jar:?] at org.holoeasy.packet.metadata.text.IMetadataTextPacket$DefaultImpls.metadata$default(IMetadataTextPacket.kt:8) ~[parcour-1.0.0-RELEASE.jar:?] at org.holoeasy.line.TextLine$pvt$1.show(TextLine.kt:93) ~[parcour-1.0.0-RELEASE.jar:?] at org.holoeasy.hologram.Hologram.show(Hologram.kt:103) ~[parcour-1.0.0-RELEASE.jar:?] at org.holoeasy.pool.HologramPool.hologramTick$lambda$4(HologramPool.kt:71) ~[parcour-1.0.0-RELEASE.jar:?] at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.19.4.jar:git-Paper-550] at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[paper-1.19.4.jar:git-Paper-550] at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[paper-1.19.4.jar:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?] at java.lang.Thread.run(Thread.java:1575) ~[?:?] [19:45:02] [Craft Scheduler Thread - 1 - Parcour/WARN]: [Parcour] Plugin Parcour v1.0.0-RELEASE generated an exception while executing task 22 java.lang.NullPointerException: constructor at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:907) ~[guava-31.1-jre.jar:?] at com.comphenix.protocol.reflect.accessors.MethodHandleHelper.getConstructorAccessor(MethodHandleHelper.java:70) ~[ProtocolLib.jar:?] at com.comphenix.protocol.reflect.accessors.Accessors.getConstructorAccessor(Accessors.java:167) ~[ProtocolLib.jar:?] at com.comphenix.protocol.reflect.accessors.Accessors.getConstructorAccessor(Accessors.java:145) ~[ProtocolLib.jar:?] at com.comphenix.protocol.wrappers.LegacyDataWatcher.newHandle(LegacyDataWatcher.java:113) ~[ProtocolLib.jar:?] at com.comphenix.protocol.wrappers.LegacyDataWatcher.<init>(LegacyDataWatcher.java:108) ~[ProtocolLib.jar:?] at com.comphenix.protocol.wrappers.LegacyDataWatcher.<init>(LegacyDataWatcher.java:85) ~[ProtocolLib.jar:?] at com.comphenix.protocol.wrappers.WrappedDataWatcher.<init>(WrappedDataWatcher.java:86) ~[ProtocolLib.jar:?] at org.holoeasy.packet.metadata.text.MetadataTextPacketD.metadata(MetadataTextPacketD.kt:18) ~[parcour-1.0.0-RELEASE.jar:?] at org.holoeasy.packet.metadata.text.IMetadataTextPacket$DefaultImpls.metadata$default(IMetadataTextPacket.kt:8) ~[parcour-1.0.0-RELEASE.jar:?] at org.holoeasy.line.TextLine$pvt$1.show(TextLine.kt:93) ~[parcour-1.0.0-RELEASE.jar:?] at org.holoeasy.hologram.Hologram.show(Hologram.kt:103) ~[parcour-1.0.0-RELEASE.jar:?] at org.holoeasy.pool.HologramPool.hologramTick$lambda$4(HologramPool.kt:71) ~[parcour-1.0.0-RELEASE.jar:?] at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftTask.run(CraftTask.java:101) ~[paper-1.19.4.jar:git-Paper-550] at org.bukkit.craftbukkit.v1_19_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:57) ~[paper-1.19.4.jar:git-Paper-550] at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[paper-1.19.4.jar:?] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?] at java.lang.Thread.run(Thread.java:1575) ~[?:?]
I have the same issues, to replicate this simply create a new object of new WrappedDataWatcher();
. I use the latest version of ProtocolLib and tested on paper 1.20.1 and 1.21. However on 1.21 it has a different error.
Here's the error
[18:26:44 ERROR]: Error sending packet clientbound/minecraft:set_entity_data (skippable? false)
io.netty.handler.codec.EncoderException: Failed to encode packet 'clientbound/minecraft:set_entity_data'
at net.minecraft.network.codec.IdDispatchCodec.encode(IdDispatchCodec.java:53) ~[paper-1.21.jar:1.21-89-44c3dd0]
at net.minecraft.network.codec.IdDispatchCodec.encode(IdDispatchCodec.java:20) ~[paper-1.21.jar:1.21-89-44c3dd0]
at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:26) ~[paper-1.21.jar:1.21-89-44c3dd0]
at net.minecraft.network.PacketEncoder.encode(PacketEncoder.java:12) ~[paper-1.21.jar:1.21-89-44c3dd0]
at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:113) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:120) ~[netty-codec-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:863) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:968) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:856) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.ChannelOutboundHandlerAdapter.write(ChannelOutboundHandlerAdapter.java:113) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at net.minecraft.network.Connection$2.write(Connection.java:762) ~[paper-1.21.jar:1.21-89-44c3dd0]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:881) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:940) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:966) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:934) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1020) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:311) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at ProtocolLib (12).jar/com.comphenix.protocol.injector.netty.channel.NettyChannelProxy.writeAndFlush(NettyChannelProxy.java:227) ~[ProtocolLib (12).jar:?]
at ProtocolLib (12).jar/com.comphenix.protocol.injector.netty.channel.NettyChannelProxy.writeAndFlush(NettyChannelProxy.java:233) ~[ProtocolLib (12).jar:?]
at net.minecraft.network.Connection.doSendPacket(Connection.java:513) ~[paper-1.21.jar:1.21-89-44c3dd0]
at net.minecraft.network.Connection.lambda$sendPacket$13(Connection.java:498) ~[paper-1.21.jar:1.21-89-44c3dd0]
at ProtocolLib (12).jar/com.comphenix.protocol.injector.netty.channel.NettyEventLoopProxy.lambda$proxyRunnable$2(NettyEventLoopProxy.java:49) ~[ProtocolLib (12).jar:?]
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569) ~[netty-transport-4.1.97.Final.jar:4.1.97.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) ~[netty-common-4.1.97.Final.jar:4.1.97.Final]
at java.base/java.lang.Thread.run(Thread.java:1583) ~[?:?]
Caused by: java.lang.ClassCastException: class net.minecraft.network.syncher.SynchedEntityData$DataItem cannot be cast to class net.minecraft.network.syncher.SynchedEntityData$DataValue (net.minecraft.network.syncher.SynchedEntityData$DataItem and net.minecraft.network.syncher.SynchedEntityData$DataValue are in unnamed module of loader java.net.URLClassLoader @4e515669)
at net.minecraft.network.protocol.game.ClientboundSetEntityDataPacket.pack(ClientboundSetEntityDataPacket.java:23) ~[paper-1.21.jar:1.21-89-44c3dd0]
at net.minecraft.network.protocol.game.ClientboundSetEntityDataPacket.write(ClientboundSetEntityDataPacket.java:44) ~[paper-1.21.jar:1.21-89-44c3dd0]
at net.minecraft.network.codec.StreamCodec$2.encode(StreamCodec.java:38) ~[paper-1.21.jar:1.21-89-44c3dd0]
at net.minecraft.network.codec.StreamCodec$5.encode(StreamCodec.java:88) ~[paper-1.21.jar:1.21-89-44c3dd0]
at net.minecraft.network.codec.StreamCodec$5.encode(StreamCodec.java:78) ~[paper-1.21.jar:1.21-89-44c3dd0]
... 39 more