[2.0.27] Allow LuaEntity::get_recipe() for 'furnace'
Posted: Thu Dec 19, 2024 11:33 am
Hi,
I've encountered this issue with my mod Factory Efficiency Tracker (https://mods.factorio.com/mod/factory-e ... cy-tracker).
When reading an entity's recipe, there's "get_recipe()" if type is "crafting-machine" and "previous_recipe" if type is "furnace".
However, a furnace starting crafting iron plates would never return "previous_recipe" until it stops or it changes recipe. This is quite the limitation as a furnace that starts crafting plates from ore and it's 100% fulfilled in input/output will never return any information about the recipe used/currently used for the whole game.
In this example (attachment: 10_crafts.png), a furnace is provided with 10 iron ore. No recipe is available until it stops or until I swap some iron for copper ore.
Technically, even returning "iron-plate" as "previous_recipe" after the 1st iron plate has been crafted would already be an upgrade of the current API.
Would be even better if "get_recipe()" method would work for both "crafting-machine" and "furnace" type tho.
I've encountered this issue with my mod Factory Efficiency Tracker (https://mods.factorio.com/mod/factory-e ... cy-tracker).
When reading an entity's recipe, there's "get_recipe()" if type is "crafting-machine" and "previous_recipe" if type is "furnace".
However, a furnace starting crafting iron plates would never return "previous_recipe" until it stops or it changes recipe. This is quite the limitation as a furnace that starts crafting plates from ore and it's 100% fulfilled in input/output will never return any information about the recipe used/currently used for the whole game.
In this example (attachment: 10_crafts.png), a furnace is provided with 10 iron ore. No recipe is available until it stops or until I swap some iron for copper ore.
Technically, even returning "iron-plate" as "previous_recipe" after the 1st iron plate has been crafted would already be an upgrade of the current API.
Would be even better if "get_recipe()" method would work for both "crafting-machine" and "furnace" type tho.