Dank Storage Fabric

Dank Storage Fabric

3M Downloads

Crash when picking up item 1.17.1

superdumpling opened this issue ยท 3 comments

commented

crash when picking up any item
some context: dank was working mostly fine up until I had an unrelated crash with rswires ( now fixed ), however dank is still broken after that crash. I've crashed many times before that crash and dank was fine after reloading the game except the rswires crash. From what I can tell ( may be wrong ) somehow, the "inv" of the danks were removed by that specific rswires crash, but that doesn't really explain how the older backups where dank was working fine crash with the same log. No matter what I try I am unable to get back the items I had in them, also using nbt explorer I was able to see that there were multiple entries of level.dat and playerdata in my world, I'm not sure if that's to do with dank breaking because in the older backups there were only 2 of each, like level.dat and level.dat_old.
image
If the bug is unfixable, Is there a way to view the contents of the danks in previous backups without loading in (and crashing)? I'll take anything at this point, I just want my items in the danks back. I don't rlly care about the items that were in the docks.
sorry for the text wall

-----------------------------------------------

Description: Ticking player

java.lang.NullPointerException: Cannot invoke "tfar.dankstorage.world.DankInventory.method_5439()" because "inv" is null
at tfar.dankstorage.event.MixinHooks.onItemPickup(MixinHooks.java:47)
at tfar.dankstorage.event.MixinHooks.interceptItem(MixinHooks.java:32)
at net.minecraft.class_1661.handler$bep000$interceptItems(class_1661.java:2187)
at net.minecraft.class_1661.method_7394(class_1661.java)
at net.minecraft.class_1542.handler$bnf000$tryInsertQuiver(class_1542.java:1605)
at net.minecraft.class_1542.method_5694(class_1542.java)
at net.minecraft.class_1657.method_7341(class_1657.java:620)
at net.minecraft.class_1657.method_6007(class_1657.java:593)
at net.minecraft.class_1309.method_5773(class_1309.java:2346)
at net.minecraft.class_1657.method_5773(class_1657.java:274)
at net.minecraft.class_3222.method_14226(class_3222.java:466)
at net.minecraft.class_3244.method_18784(class_3244.java:212)
at net.minecraft.class_2535.method_10754(class_2535.java:238)
at net.minecraft.class_3242.method_14357(class_3242.java:183)
at net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:902)
at net.minecraft.server.MinecraftServer.method_3748(MinecraftServer.java:831)
at net.minecraft.class_1132.method_3748(class_1132.java:118)
at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:697)
at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:270)
at java.base/java.lang.Thread.run(Thread.java:831)

A detailed walkthrough of the error, its code path and all known details is as follows:

-- Head --
Thread: Server thread
Stacktrace:
at tfar.dankstorage.event.MixinHooks.onItemPickup(MixinHooks.java:47)
at tfar.dankstorage.event.MixinHooks.interceptItem(MixinHooks.java:32)
at net.minecraft.class_1661.handler$bep000$interceptItems(class_1661.java:2187)
at net.minecraft.class_1661.method_7394(class_1661.java)
at net.minecraft.class_1542.handler$bnf000$tryInsertQuiver(class_1542.java:1605)
at net.minecraft.class_1542.method_5694(class_1542.java)
at net.minecraft.class_1657.method_7341(class_1657.java:620)

-- Patchouli Book Info --
Details:
Patchouli open book context: n/a
Stacktrace:
at net.minecraft.class_128.handler$bfk000$fillPatchouliContext(class_128.java:521)
at net.minecraft.class_128.(class_128.java:48)
at net.minecraft.class_128.method_560(class_128.java:342)
at net.minecraft.class_3222.method_14226(class_3222.java:525)
at net.minecraft.class_3244.method_18784(class_3244.java:212)
at net.minecraft.class_2535.method_10754(class_2535.java:238)
at net.minecraft.class_3242.method_14357(class_3242.java:183)
at net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:902)
at net.minecraft.server.MinecraftServer.method_3748(MinecraftServer.java:831)
at net.minecraft.class_1132.method_3748(class_1132.java:118)
at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:697)
at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:270)
at java.base/java.lang.Thread.run(Thread.java:831)

-----------------------------------------------

also crashing on world join that was happening before removing the docks in a world editor

-----------------------------------------------

[22:39:46] [Server thread/ERROR]: Encountered an unexpected exception
net.minecraft.class_148: Exception ticking world
at net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:895) ~[intermediary-fabric-loader-0.11.6-1.17.1.jar:?]
at net.minecraft.server.MinecraftServer.method_3748(MinecraftServer.java:831) ~[intermediary-fabric-loader-0.11.6-1.17.1.jar:?]
at net.minecraft.class_1132.method_3748(class_1132.java:118) ~[intermediary-fabric-loader-0.11.6-1.17.1.jar:?]
at net.minecraft.server.MinecraftServer.method_29741(MinecraftServer.java:697) ~[intermediary-fabric-loader-0.11.6-1.17.1.jar:?]
at net.minecraft.server.MinecraftServer.method_29739(MinecraftServer.java:270) ~[intermediary-fabric-loader-0.11.6-1.17.1.jar:?]
at java.lang.Thread.run(Thread.java:831) [?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "tfar.dankstorage.world.DankInventory.method_5439()" because the return value of "tfar.dankstorage.blockentity.DockBlockEntity.getInventory()" is null
at tfar.dankstorage.blockentity.DockBlockEntity.method_5439(DockBlockEntity.java:106) ~[dankstorage-2.1-1.17.1.jar:?]
at alexiil.mc.lib.attributes.item.compat.FixedInventoryViewVanillaWrapper.getSlotCount(FixedInventoryViewVanillaWrapper.java:31) ~[1c69892f-626d-4a5d-80aa-693f511b9f9c.jar:?]
at alexiil.mc.lib.attributes.item.impl.GroupedItemInvFixedWrapper.simpleDumbBadInsertionToBeRemoved(GroupedItemInvFixedWrapper.java:41) ~[1c69892f-626d-4a5d-80aa-693f511b9f9c.jar:?]
at alexiil.mc.lib.attributes.item.impl.GroupedItemInvFixedWrapper.attemptInsertion(GroupedItemInvFixedWrapper.java:37) ~[1c69892f-626d-4a5d-80aa-693f511b9f9c.jar:?]
at alexiil.mc.lib.attributes.item.filter.ItemInsertableFilter.matches(ItemInsertableFilter.java:32) ~[1c69892f-626d-4a5d-80aa-693f511b9f9c.jar:?]
at alexiil.mc.lib.attributes.item.filter.AggregateItemFilter.matches(AggregateItemFilter.java:186) ~[1c69892f-626d-4a5d-80aa-693f511b9f9c.jar:?]
at alexiil.mc.lib.attributes.item.FixedItemInv.extractStack(FixedItemInv.java:158) ~[1c69892f-626d-4a5d-80aa-693f511b9f9c.jar:?]
at alexiil.mc.lib.attributes.item.impl.GroupedItemInvFixedWrapper.attemptExtraction(GroupedItemInvFixedWrapper.java:60) ~[1c69892f-626d-4a5d-80aa-693f511b9f9c.jar:?]
at alexiil.mc.lib.attributes.item.ItemInvUtil.move(ItemInvUtil.java:110) ~[1c69892f-626d-4a5d-80aa-693f511b9f9c.jar:?]
at alexiil.mc.lib.attributes.item.ItemInvUtil.move(ItemInvUtil.java:91) ~[1c69892f-626d-4a5d-80aa-693f511b9f9c.jar:?]
at me.steven.indrev.networks.item.ItemNetwork.tickOutput$doMove(ItemNetwork.java:102) ~[indrev-1.10.0-alpha.11.jar:?]
at me.steven.indrev.networks.item.ItemNetwork.tickOutput(ItemNetwork.java:108) ~[indrev-1.10.0-alpha.11.jar:?]
at me.steven.indrev.networks.item.ItemNetwork.tick(ItemNetwork.java:58) ~[indrev-1.10.0-alpha.11.jar:?]
at me.steven.indrev.networks.NetworkState.tick(NetworkState.java:61) ~[indrev-1.10.0-alpha.11.jar:?]
at me.steven.indrev.networks.ServoNetworkState.tick(ServoNetworkState.java:31) ~[indrev-1.10.0-alpha.11.jar:?]
at me.steven.indrev.networks.NetworkEvents.onEndTick(NetworkEvents.java:13) ~[indrev-1.10.0-alpha.11.jar:?]
at net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents.lambda$static$6(ServerTickEvents.java:108) ~[42dbf5c1-e250-4699-8a87-604abd38bd5e.jar:?]
at net.minecraft.class_1937.handler$cff000$tickWorldAfterBlockEntities(class_1937.java:4094) ~[intermediary-fabric-loader-0.11.6-1.17.1.jar:?]
at net.minecraft.class_1937.method_18471(class_1937.java:479) ~[intermediary-fabric-loader-0.11.6-1.17.1.jar:?]
at net.minecraft.class_3218.method_18765(class_3218.java:422) ~[intermediary-fabric-loader-0.11.6-1.17.1.jar:?]
at net.minecraft.server.MinecraftServer.method_3813(MinecraftServer.java:891) ~[intermediary-fabric-loader-0.11.6-1.17.1.jar:?]

-----------------------------------------------

commented

I loaded mc with the mod removed and it didn't crash, reloaded with the mod reinstalled but when I copy and pasted the danks into my inventory from a previous backup using nbt editor, all my items that were in them are gone

commented

Reviewing the source code and the error message above, it looks like inv should be checked for null in the MixinHooks.onItemPickup method.

Apparently, Utils.getInventory can return null, which causes a null reference exception later in the method. I don't know the best way to handle this, but a null check and exiting the method could prevent a crash (though it might be good to log the condition and other details...)

 DankInventory inv = Utils.getInventory(dank,player.level);

(Note: I'm a .Net developer and my tools are not setup for Java, so I'll have difficulty submitting a runtime tested PR)

commented

"inv" is no longer a thing in 1.17 as it was moved to be fully serverside in 1.17. Hence this bug report is invalid.