Refined Storage

Refined Storage

77M Downloads

Api question

SirEndii opened this issue ยท 7 comments

commented

Issue description:

I recreate some systems for my RsBridge and I noticed, my functions breaks the storage network. When I try to get the items stored in the system with NetworkNodeTile#getNode#getNetwork#ggetItemStorage#getList, it breaks the system, I can't craft anything, I can't import items into the system with an importer(It always creates a new stack). Literally everything is broken.

I just ask what can I do, to prevent something like that?

commented

That does not sound like something that would be caused by trying to get the Item Storage Cache. We quite regularly access that pretty much the same way.

Check your log for errors or profile things if the world is stuck or something.

commented

Are you modifying the stacks returned in #getList?

commented

IntelligenceModding/AdvancedPeripherals#69 Here is an issue report with a good video which explains the issue very good.

Check your log for errors or profile things if the world is stuck or something.

Nothing there, but I found a bad solution. I can call IStorageCache#invalidate and this fixes the issue. But that doesn't work for patterns and I don't think, that this is a good solution.

commented
commented

Copy them before putting it into a list.

https://github.com/Seniorendi/AdvancedPeripherals/blob/master/src/main/java/de/srendi/advancedperipherals/common/addons/refinedstorage/RefinedStorage.java#L158

result.add(entry.getStack().copy());

And stop calling invalidate, it's not supposed to be used that way.

commented

And stop calling invalidate, it's not supposed to be used that way.

Yes, I know. I just tested it with that.

Copy them before putting it into a list.

Thank you! I will try that.

commented

Copy them before putting it into a list.

That works perfectly. Thank you guys!