
Crafting loop
jorgebonafe opened this issue ยท 8 comments
So I have a chest with a provider module, and an active supplier module. The supplier requests infinite blocks of lapis (this issue happens with any "block of" item). I have two auto crafting tables, one crafts lapis blocks, one crafts 9 lapis from lapis block.
If I have just one block of lapis in the chest, it gets pulled out, crafted into 9 lapis, immediately sent to craft a lapis block, and sent back to chest, repeat forever. I tried messing with the crafting pipes' priority, didn't change anything.
I'm not sure if this is supposed to happen, seems like it shouldn't. If it is, is it even possible to have a setup that requests blocks from an item, while allowing them to be crafted back and forth when needed?
Edit. I attached a world save with the simplified setup if it helps
I really don't know what do you expect to happen. This is a recipe loop and it is kind of intentional. LP should not avoid to shoot your foot, it's just a most effective way to craft bullets, pistol and route these tools right in your hand.
Ok, my intention was to get items in my inventories and compress them as much as possible while still allowing them to decompress if I needed to automatically craft other stuff. As far as I can see the active supplier is the only way to do this.
I see what you are saying, but what this is doing is taking a compressed item and crafting it again from itself. I assumed this wasn't intended behaviour, because if it is, it would make it impossible to do the above.
Also, I think I understand why it happens. It seems like the pipe is requesting the item, and finding a crafting recipe. But then the recipe takes "1 x item A" to make "1 x item A", so it still feels like this shouldn't happen. I suppose because there are two steps the pipe doesn't know that the first step takes the same item as it gets in the last one, so it requests anyway?
So, what I want to do is not possible?
it is possible but a little fidely, you'll need to create a seperate LP network, have the main network dump all the lapis (items, no blocks) it gets (itemsink/passive supplier, definatly no active or it will loop again)
also to that chest is a provider module (be carefull not to connect to your main network, for power you can use a firewall pipe that blocks everything but power), then add a craftnig pipe and table to craft lapis into blocks (only that), then a 2nd chest (or barrel/...) where infinite blcoks of lapis are requested
then connect a provider on your main LP network to the output chest and teach the main system how to uncraft blocks into items
now it will compress everything it will uncraft the blocks when needed, if you want to keep some on hand you can add a provider on the main network on the chest where you dump the lapis, then set the provider of the subnetwork to ignore the first stack, that way there will be 64 lapis not compressed (untill you use it up, then it needs to uncraft and wait for lapis to come in to fill that 64 buffer again)
I see, so each network only knows one recipe, it breaks the loop... Thanks a lot, man :)
indeed, and that combined with not using active requests, otherwise the loop will still persist (uncrafting to feed the subsystem)
Ok, it worked. For posterity, here is how I set it up.
====cT
^x
IP==== (main)
I: chest
P: pipe with provider, item sink(lapis item), goes to main network
^:pipe with provider(lapis, leaves 1st stack), active supplier (lapis block, infinite), goes to secondary network
x: firewall, allows power only
=:gold pipe
cT: crafting pipe and table (makes lapis blocks)
This setup requests lapis blocks infinitely, but doesn't touch the last stack of lapis. Keeps it all in a single chest without problems, no loops.
@AEnterprise Thanks again for the help man, really appreciate it
Technically, it could be solved by the LP network on its own by detecting and breaking recipe cycles, but it's very hard and very expensive in runtime since it's a difficult tree-graph crawling. So it's better to avoid recipe cycles anyway, instead store items in barrels or stuff and craft blocks when possible, or craft blocks at the entry point some non-LP way (e.g. BC crafting tables, RFTools crafters, XU pipes and so on) and then store only lapis blocks. In the latter case LP will see only lapis blocks and lapis recipe.
Be careful, it's not an LP-specific issue! Some other networks that handle crafting recipes, like Refined Storage or Applied Energistics could have same or similar issue. It's a rule of thumb to not create recipe cycles in any storage network, it's just safer and cleaner feeling.