grondag / facility

GNU Lesser General Public License v3.0
1 stars 1 forks source link

inmis backpacks lose contents when stored in a crate #13

Closed Katorone closed 4 years ago

Katorone commented 4 years ago

When storing an inmis backpack in a facility:crate_item it is emptied of all content. I'm not sure if I'm right reporting this here, or if this is something inmis can fix, or if it even can be fixed in an universal way.

https://www.curseforge.com/minecraft/mc-mods/inmis

grondag commented 4 years ago

Thank you for the report. Not obvious why it would happen but will have a look as time allows.

haykam821 commented 4 years ago

Could it be due to using cardinal components?

grondag commented 4 years ago

@haykam821 Yes, it is because of how CCA handles item stack serialization. The component info is kept out of the stack tag unless specifically serialized or otherwise requested. I'm not sure yet how to make this performant, as it seems I will need to serialize every stack vs just compare tags.

@Pyrofab Any thoughts on how to handle this?

grondag commented 4 years ago

I think the short-term solution here is to blacklist any items that have CCA components. However, there doesn't seem to be a performant way to query that, either. At least not a supported one. Will keep looking.

Katorone commented 4 years ago

As a server admin I'd be very happy already with a configurable blacklist. If i can blacklist inmis:* (or even item per item, inmis:frayed_backpack) from going into crates, that'd be great.

grondag commented 4 years ago

Agree a blacklist would be handy in any case.

grondag commented 4 years ago

Fixed in next build via configurable blacklist.

Pyrofab commented 4 years ago

Oh, missed this issue. I would recommend retrieving the ComponentContainer via ComponentProvider, then serializing it to NBT yourself.