I would love to use `LuaItemStack:export_stack` call in my mod, to move around items from a massive amount of belts keeping stacks unchanged with same position, however it only covers items that have the ingame "export" functionality.
Currently I am using `get_detailed_contents` on the belt, to keep stacks unchanged, I use `transfer_stack` call. However, that makes all previous stacks (returned by the `get_detailed_contents` method) invalid... so I need to recall it for each stacks left on the belt. This scales up quite badly w/ many belts and items on them...
If there would be some serialize call on `LuaItemStack` I could just save that together with stack-belt-positions, hitting the game-API only once for the `get_detailed_contents`, then empty the whole belt and reimport.
Inserting happens one-by-one too (using the game-API), so I guess it would still not change the order-of-magnitude, just the `get_detailed_contents` feels like a more expensive method, not sure though.
Any chance "export_stack" API will handle any LuaItemStack?
- freeafrica
- Long Handed Inserter

- Posts: 63
- Joined: Mon Aug 19, 2019 2:33 pm
- Contact:
Any chance "export_stack" API will handle any LuaItemStack?
- nerf landmines, bots
- change infinite resources (solar, space-mining, etc...)
- change infinite resources (solar, space-mining, etc...)
Re: Any chance "export_stack" API will handle any LuaItemStack?
What are you actually trying to do? “Get detailed contents” can be used backwards to move entire lines. Or if you just want a copy then clone the belt. If you want a new belt at the same position then fast replace it.
If you want to get ahold of me I'm almost always on Discord.
