NPE in Packet Listener
frkntmbs opened this issue · 24 comments
I get this error in version 1.12.2 and a similar error is also present in the papper version
[00:12:47] [Netty Server IO #3/WARN]: [OldCombatMechanics] Error in a packet listener (send).
java.lang.NullPointerException: null
at java.util.HashSet.<init>(Unknown Source) ~[?:1.8.0_201]
at gvlfm78.plugin.OldCombatMechanics.utilities.teams.TeamPacket.adjustToPlayerRemoved(TeamPacket.java:94) ~[?:?]
at gvlfm78.plugin.OldCombatMechanics.utilities.teams.TeamPacket.adjustToUpdate(TeamPacket.java:44) ~[?:?]
at gvlfm78.plugin.OldCombatMechanics.module.ModulePlayerCollisions$CollisionPacketListener.updateToPacket(ModulePlayerCollisions.java:157) ~[?:?]
at gvlfm78.plugin.OldCombatMechanics.module.ModulePlayerCollisions$CollisionPacketListener.onPacketSend(ModulePlayerCollisions.java:119) ~[?:?]
at gvlfm78.plugin.OldCombatMechanics.utilities.packet.PacketInjector.write(PacketInjector.java:162) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:738) ~[spigot.jar:git-Spigot-dcd1643-e60fc34]
at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:801) ~[spigot.jar:git-Spigot-dcd1643-e60fc34]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:814) ~[spigot.jar:git-Spigot-dcd1643-e60fc34]
at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:794) ~[spigot.jar:git-Spigot-dcd1643-e60fc34]
at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:831) ~[spigot.jar:git-Spigot-dcd1643-e60fc34]
at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1071) ~[spigot.jar:git-Spigot-dcd1643-e60fc34]
at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:300) ~[spigot.jar:git-Spigot-dcd1643-e60fc34]
at com.comphenix.protocol.injector.netty.ChannelProxy.writeAndFlush(ChannelProxy.java:327) ~[?:?]
at net.minecraft.server.v1_12_R1.NetworkManager$4.run(NetworkManager.java:200) ~[spigot.jar:git-Spigot-dcd1643-e60fc34]
at com.comphenix.protocol.injector.netty.ChannelInjector$3.lambda$onMessageScheduled$1(ChannelInjector.java:310) ~[?:?]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) [spigot.jar:git-Spigot-dcd1643-e60fc34]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) [spigot.jar:git-Spigot-dcd1643-e60fc34]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463) [spigot.jar:git-Spigot-dcd1643-e60fc34]
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884) [spigot.jar:git-Spigot-dcd1643-e60fc34]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_201]
Some of it is like this: https://pastebin.com/Pcd5KSCh
latets log:
latest.log
Try this dev build: https://ci.rayzr.dev/job/OldCombatMechanics/75/
Thank you. When is this error thrown? Is it when players leave, join, or is it some other action?
I'm not sure, it doesn't always happen. I think it happens when they enter a combat.
(You can see the Spigot build via /version
or in the latest.log file towards the start)
[23:44:17 INFO]: This server is running Paper version git-Paper-1618 (MC: 1.12.2
) (Implementing API version 1.12.2-R0.1-SNAPSHOT)
I didn't see this error before installing this plugin
ActionBarAPI, AncientGates, antiRedstoneClock, AntiWDL, ArmorStandEditor, AsyncWorldEdit, AsyncWorldEditInjector, AutoMessage, Banknotes, BKCommonLib, boosCooldowns, ChestCommands, ChestShop, ClearLag, CounterStrike, CustomPayloadFixer, DisableJoinMessage, EasyBackup, Essentials
, EssentialsChat, EssentialsSpawn, ExtrasSK, FactionChat, Factions, FastCraft, HealthBar, HolographicDisplays, IllegalStack, LaunchPadPlus, LeakParkour, LibsDisguises, LightCleaner, LockettePro, MassiveCore, MineResetLite, Minigames, Minigames-Regions, Multiverse-Core, MyCommand, MythicMobs, NMExtensions, NMFutbol, NMObligations, NMPlotPremium, NMProfessions, NoCheatPlus, OldCombatMechanics, OnlyProxyJoin, PermissionsEx, PlaceholderAPI, PlotSquared, PlugMan, ProtocolLib, PvPManager, QuickShop, SafeTrade, SharpSK, SkAction, skDragon, Skellett, SkinsRestorer, SkQuery, skRayFall, Skript, SkUniversal, skUtilities, TAB, UnioAntiCrash, UUIDSpoof-Fix, Vault, Websend, WildSkript, WorldBorder, WorldEdit, WorldGuard
Can you try this build? Unzip and copy the jar file. It will output stuff to the console that I need.
OCM.zip
Or maybe even this which also logs packet listeners:
OCM.zip
The important part is when an error happens. It should write NULL DETECTED
in the console and then there will probably be the stacktrace. I need the stuff right below that null detected and the registered channel listeners it outputs with the second jar I posted on startup.
Can you show the few lines above the second screenshot as well? You can most likely copy-paste it from latest.log
.
[00:17:35] [Netty Server IO #2/INFO]: a=>0004zhywor�
[00:17:35] [Netty Server IO #2/INFO]: b=>0004zhywor�
[00:17:35] [Netty Server IO #2/INFO]: c=>[A]
[00:17:35] [Netty Server IO #2/INFO]: d=>
[00:17:35] [Netty Server IO #2/INFO]: e=>never
[00:17:35] [Netty Server IO #2/INFO]: f=>never
[00:17:35] [Netty Server IO #2/INFO]: g=>-1
[00:17:35] [Netty Server IO #2/INFO]: h=>null
[00:17:35] [Netty Server IO #2/INFO]: i=>2
[00:17:35] [Netty Server IO #2/INFO]: j=>69
[00:17:35] [Netty Server IO #2/WARN]: [OldCombatMechanics] Error in a packet listener (send).
java.lang.NullPointerException: null
at java.util.HashSet.<init>(Unknown Source) ~[?:1.8.0_201]
at kernitus.plugin.OldCombatMechanics.utilities.teams.TeamPacket.adjustToPlayerAdded(TeamPacket.java:86) ~[?:?]
at kernitus.plugin.OldCombatMechanics.utilities.teams.TeamPacket.adjustToUpdate(TeamPacket.java:41) ~[?:?]
at kernitus.plugin.OldCombatMechanics.module.ModulePlayerCollisions$CollisionPacketListener.updateToPacket(ModulePlayerCollisions.java:157) ~[?:?]
at kernitus.plugin.OldCombatMechanics.module.ModulePlayerCollisions$CollisionPacketListener.onPacketSend(ModulePlayerCollisions.java:119) ~[?:?]
at kernitus.plugin.OldCombatMechanics.utilities.packet.PacketInjector.write(PacketInjector.java:170) ~[?:?]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:738) ~[spigot.jar:git-Paper-1618]
at io.netty.channel.AbstractChannelHandlerContext.invokeWriteAndFlush(AbstractChannelHandlerContext.java:801) ~[spigot.jar:git-Paper-1618]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:814) ~[spigot.jar:git-Paper-1618]
at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:794) ~[spigot.jar:git-Paper-1618]
at io.netty.channel.AbstractChannelHandlerContext.writeAndFlush(AbstractChannelHandlerContext.java:831) ~[spigot.jar:git-Paper-1618]
at io.netty.channel.DefaultChannelPipeline.writeAndFlush(DefaultChannelPipeline.java:1071) ~[spigot.jar:git-Paper-1618]
at io.netty.channel.AbstractChannel.writeAndFlush(AbstractChannel.java:300) ~[spigot.jar:git-Paper-1618]
at com.comphenix.protocol.injector.netty.ChannelProxy.writeAndFlush(ChannelProxy.java:327) ~[?:?]
at net.minecraft.server.v1_12_R1.NetworkManager$4.run(NetworkManager.java:215) ~[spigot.jar:git-Paper-1618]
at com.comphenix.protocol.injector.netty.ChannelInjector$3.lambda$onMessageScheduled$1(ChannelInjector.java:310) ~[?:?]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) ~[spigot.jar:git-Paper-1618]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:404) ~[spigot.jar:git-Paper-1618]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:463) ~[spigot.jar:git-Paper-1618]
at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884) ~[spigot.jar:git-Paper-1618]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_201]
[00:17:39]
Please post your full latest.log, either uploading it here as an attachment or on https://pastebin.com