Dank Storage

Dank Storage

28M Downloads

Game crash when new dank is used in conjunction with modded items that can extract items.

Arkaeic opened this issue ยท 1 comments

commented

This crash happened with both a Building Gadget and a Construction Wand (2 separate mods)

It looks like when a new dank is made, it's given an ID of -1. until opened. When showing a placement preview by looking at a block with a construction wand in your hand, the game will crash if you have an un-instantiated dank. I'm guessing this is because the danks aren't given their own inventory until opened (suggested by the -1 ID). This means that when items such as the construction wand or building gadget find a dank in your inventory and try to search the dank's inventory, it doesn't find one.

In the building gadgets case, it happened when mousing over the copy paste tool, which would normally show you a block list in it's tooltip and tells you how many more blocks of each type you will need. The error occurs when trying to evaluate the quantity of blocks in the players inventory and searches a new dank to create said tooltip, I believe.

This is confirmed by the fact that the issue in both cases is: "LazyOptional is empty or otherwise returned null from getValue() unexpectedly" which I believe occurs when a mod tries to parse the dank's storage to a LazyOptional, because it assumes that it's parsing an inventory, when in actuality it's parsing a null value.

This issue can be circumvented by simply opening the dank in bag mode, thus instantiating it, which assigns the dank it's own inventory and ID. This should probably be fixed though.

Here is the full error code if you need confirmation:
https://pastebin.com/mYRaXJJ2

commented

fixed in 4.1.5