This code is supposed to take items as input and output, and:
- Add the tags from every input to every output
- Remove all tags from every input
- Add a 'hidden' tag for use in client
- Take all recipes that have an input item as input (for the recipe) and replace it for all outputs
Currently, it can do two of these things [2, 4] flawlessly in every use case and all of them only if every use is single item only.
I've divided the code in 4 cases:
a. There is only one input and output
b. There is many inputs and one output
c. There is one input and many outputs
d. Both are many items
I don't know why exactly the copying works as it does, but upon testing I've ruled in a few kinks of it:
- When copying tags, it copies asynchronically (I know this because I've got another function in another file that specifically adds a blacklist if the item is hidden)
- When deleting tags, all tags are deleted, included output. I've yet to figure out why
- When adding tags to two different output items from one input item, none of them get the tags
I've racked my brain trying to solve this, I'd really appreciate if someone helped me figure this one out.

