NullPointerException and lag when accessing corpse
ameisen opened this issue ยท 8 comments
Bug description
When accessing a corpse on a 1.16.1 server, a NullPointerException
is thrown.
It appears to be occurring on this line:
return Death.fromNBT(CompressedStreamTools.read(getDeathFile(player, id)));
And is being thrown at:
compoundNBT.put("death", death.toNBT(false));
I assume that somehow either compoundNBT
or death
are null
. I have not debugged this, I am not set up to develop Minecraft mods.
This server is running Java 11 on Linux. I have not tested it on Java 8, Java 14, or Java 14-MC.
Steps to reproduce the issue
- Access corpse.
- Observe
Expected behavior
No exception would be thrown.
Log files
[18:39:04] [Server thread/INFO] [STDERR/]: [de.maxhenkel.corpse.DeathManager:getDeath:33]: java.lang.NullPointerException
[18:39:04] [Server thread/FATAL] [minecraft/ThreadTaskExecutor]: Error executing task on Server
java.lang.NullPointerException: null
at de.maxhenkel.corpse.integration.waila.HUDHandlerCorpse.appendServerData(HUDHandlerCorpse.java:71) ~[?:1.16.1-1.0.11] {re:classloading}
at de.maxhenkel.corpse.integration.waila.HUDHandlerCorpse.appendServerData(HUDHandlerCorpse.java:22) ~[?:1.16.1-1.0.11] {re:classloading}
at mcp.mobius.waila.network.MessageRequestEntity$Handler.lambda$null$0(MessageRequestEntity.java:54) ~[?:1.10.10-B77_1.16.1] {re:classloading}
at java.util.ArrayList.forEach(ArrayList.java:1541) ~[?:?] {}
at mcp.mobius.waila.network.MessageRequestEntity$Handler.lambda$null$1(MessageRequestEntity.java:54) ~[?:1.10.10-B77_1.16.1] {re:classloading}
at java.lang.Iterable.forEach(Iterable.java:75) ~[?:?] {}
at mcp.mobius.waila.network.MessageRequestEntity$Handler.lambda$onMessage$2(MessageRequestEntity.java:54) ~[?:1.10.10-B77_1.16.1] {re:classloading}
at net.minecraft.util.concurrent.TickDelayedTask.run(SourceFile:18) ~[?:?] {re:classloading}
at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213166_h(SourceFile:144) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.util.concurrent.RecursiveEventLoop.func_213166_h(SourceFile:23) ~[?:?] {re:classloading}
at net.minecraft.server.MinecraftServer.func_213166_h(MinecraftServer.java:735) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.server.MinecraftServer.func_213166_h(MinecraftServer.java:157) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213168_p(SourceFile:118) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.server.MinecraftServer.func_213205_aW(MinecraftServer.java:718) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.server.MinecraftServer.func_213168_p(MinecraftServer.java:712) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213160_bf(SourceFile:103) ~[?:?] {re:classloading,pl:accesstransformer:B}
at net.minecraft.server.MinecraftServer.func_213202_o(MinecraftServer.java:697) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:647) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at net.minecraft.server.MinecraftServer.lambda$func_240784_a_$0(MinecraftServer.java:230) ~[?:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A}
at java.lang.Thread.run(Thread.java:834) [?:?] {}
Versions
- Minecraft version: 1.16.1
- Forge version: 1.16.1-32.0.106
- Mod version: 1.0.11
Other mods
- A Block of Charcoal
- Abnormals Core
- AI Improvements
- AppleSkin
- Bamboo Spreads
- Beenfo
- Better Burning
- Biomes O'Plenty
- Cloth Config (Forge)
- Collective
- Compact Ores
- Conduits Prevent Drowned
- Double Doors
- Fast Leaf Decay
- Guard Villagers
- HWYLA Forge
- Inventory Tweaks
- Mixin Bootstrap
- Mouse Tweaks
- No Increasing Repair Cost
- OptiFine G2
- Random Patches
- RS Gauges
- Storage Overhaul
- Xaeros Minimap
- Xaeros World Map
Thank you for reporting this issue!
The fix should be up on CurseForge very soon.
I'm still getting a NullPointerException upon access, though a slightly different one and not with HWYLA, in 1.0.12. Not sure if you would like me to make a new report.
java.lang.NullPointerException
at de.maxhenkel.corpse.Death.fromNBT(Death.java:96)
at de.maxhenkel.corpse.DeathManager.getDeath(DeathManager.java:31)
at de.maxhenkel.corpse.integration.waila.HUDHandlerCorpse.appendServerData(HUDHandlerCorpse.java:70)
at de.maxhenkel.corpse.integration.waila.HUDHandlerCorpse.appendServerData(HUDHandlerCorpse.java:22)
at mcp.mobius.waila.network.MessageRequestEntity$Handler.lambda$null$0(MessageRequestEntity.java:54)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1510)
at mcp.mobius.waila.network.MessageRequestEntity$Handler.lambda$null$1(MessageRequestEntity.java:54)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at mcp.mobius.waila.network.MessageRequestEntity$Handler.lambda$onMessage$2(MessageRequestEntity.java:54)
at net.minecraft.util.concurrent.TickDelayedTask.run(SourceFile:18)
at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213166_h(SourceFile:144)
at net.minecraft.util.concurrent.RecursiveEventLoop.func_213166_h(SourceFile:23)
at net.minecraft.server.MinecraftServer.func_213166_h(MinecraftServer.java:735)
at net.minecraft.server.MinecraftServer.func_213166_h(MinecraftServer.java:157)
at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213168_p(SourceFile:118)
at net.minecraft.server.MinecraftServer.func_213205_aW(MinecraftServer.java:718)
at net.minecraft.server.MinecraftServer.func_213168_p(MinecraftServer.java:712)
at net.minecraft.util.concurrent.ThreadTaskExecutor.func_213160_bf(SourceFile:103)
at net.minecraft.server.MinecraftServer.func_213202_o(MinecraftServer.java:697)
at net.minecraft.server.MinecraftServer.func_240802_v_(MinecraftServer.java:647)
at net.minecraft.server.MinecraftServer.lambda$func_240784_a_$0(MinecraftServer.java:230)
at java.base/java.lang.Thread.run(Thread.java:832)
Can you please try it with the latest version?
To further understand this issue can you please run this command while standing next to the corpse that causes the issue and send me the output?
/data get entity @e[type=corpse:corpse,sort=nearest,limit=1]
Hi, I'm not sure if you wanted me to open a new issue or not but it seems like you managed to fix it on 1.16.2. Is it possible for you to backport this fix to 1.15.2 as well? If it's too time-consuming then that's okay, just wasn't sure what your stance was on working on older versions of the mod. Thank you!