Total Productivity for belts, landfill & everything

by AivanF

Would you like to be a diligent engineer who uses their resources efficiently? The mod allows to enable productivity modules for everything! By default, it's enabled for: logistic items (belts, inserters, chests, rails, robots, pipes), solar panels, accumulators, satellites, personal equipment, ammunition. Optionally for other buildings, vehicles, even modules!

Tweaks
1 year, 3 months ago
1.1 - 2.0
11.4K
Manufacturing

i Potential improvement for finding results better

10 months ago

I ran into this with yuoki engines, and the electric crusher (y_crusher2). The recipe produces an assembling machine and a secondary item, which results in your line:
item_name = recipe.results and #recipe.results==1 and recipe.results[1].name
failing to add productivity.
My suggestions is to add recipes which have a main product that is an item. A third condition, would be to take the main product, and if it is an item among the results, use it as the item_name. There are other ways to check if the main product is an item, but it would require longer checks.

One could also use the main_product more generally, as the current behavior is very selective in applying to only one-product recipes (which doesn't even check if the type is item, wasting work, and doesn't check if the result is among any item group vs only data.raw.item .)

10 months ago
(updated 10 months ago)

P.s. I could probably write a patch on github and do a pull request if you'd like.

Edit: Also, if it's not a fluid it is an item... I'm finding better ways to write this as I do it.

New response