juliarn / npc-lib

Asynchronous, high-performance Minecraft NPC library for 1.8-1.21 servers.
MIT License
323 stars 50 forks source link

NPE & java.lang.IllegalArgumentException #24

Closed dementisimus closed 3 years ago

dementisimus commented 3 years ago

those exceptions get thrown randomly on a newly loaded server:

java.lang.NullPointerException at net.minecraft.server.v1_16_R3.PacketDataSerializer.a(PacketDataSerializer.java:164) at net.minecraft.server.v1_16_R3.PacketPlayOutPlayerInfo.b(SourceFile:97) at net.minecraft.server.v1_16_R3.PacketEncoder.encode(PacketEncoder.java:42) at net.minecraft.server.v1_16_R3.PacketEncoder.encode(PacketEncoder.java:12) at jdk.internal.reflect.GeneratedMethodAccessor3.invoke(Unknown Source) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at com.comphenix.protocol.injector.netty.ChannelInjector.encode(ChannelInjector.java:477) at com.comphenix.protocol.injector.netty.ChannelInjector.access$100(ChannelInjector.java:64) at com.comphenix.protocol.injector.netty.ChannelInjector$1.encode(ChannelInjector.java:247) at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107) at com.comphenix.protocol.injector.netty.ChannelInjector$1.write(ChannelInjector.java:253) at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:738) at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:730) at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:816) at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:723) at protocolsupport.utils.netty.MessageToMessageEncoder.write(MessageToMessageEncoder.java:57) at protocolsupport.utils.netty.MessageToMessageCodec.write(MessageToMessageCodec.java:61) at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:738) at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:801) at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:814) at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:794) at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:831) at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1071) at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:300) at com.comphenix.protocol.injector.netty.ChannelProxy.writeAndFlush(ChannelProxy.java:327) at net.minecraft.server.v1_16_R3.NetworkManager.lambda$b$6(NetworkManager.java:300) at com.comphenix.protocol.injector.netty.ChannelInjector$3.lambda$onMessageScheduled$1(ChannelInjector.java:325) at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:465) at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884) at java.base/java.lang.Thread.run(Thread.java:834) and ::

java.lang.IllegalArgumentException: cannot send packets to a closed channel at org.apache.commons.lang.Validate.isTrue(Validate.java:136) ~[paper.jar:git-Paper-259] at com.comphenix.protocol.injector.netty.ChannelInjector.invokeSendPacket(ChannelInjector.java:687) ~[?:?] at com.comphenix.protocol.injector.netty.ChannelInjector.sendServerPacket(ChannelInjector.java:679) ~[?:?] at com.comphenix.protocol.injector.netty.ProtocolInjector$4.sendServerPacket(ProtocolInjector.java:399) ~[?:?] at com.comphenix.protocol.injector.PacketFilterManager.sendServerPacket(PacketFilterManager.java:733) ~[?:?] at com.comphenix.protocol.injector.PacketFilterManager.sendServerPacket(PacketFilterManager.java:687) ~[?:?] at com.github.juliarn.npc.modifier.NPCModifier.send(NPCModifier.java:73) ~[?:?] at com.github.juliarn.npc.NPC.show(NPC.java:51) ~[?:?] at com.github.juliarn.npc.NPCPool.lambda$npcTick$0(NPCPool.java:117) ~[?:?] at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftTask.run(CraftTask.java:99) ~[paper.jar:git-Paper-259] at org.bukkit.craftbukkit.v1_16_R3.scheduler.CraftAsyncTask.run(CraftAsyncTask.java:54) ~[paper.jar:git-Paper-259] at com.destroystokyo.paper.ServerSchedulerReportingWrapper.run(ServerSchedulerReportingWrapper.java:22) ~[paper.jar:git-Paper-259] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?] at java.lang.Thread.run(Thread.java:834) [?:?]