I like your mod ... however the heat furnace did not work at all with brevven's mods (bztitanium, bzcarbon, ...). It was missing all recipes (aluminum plate, tin plate, to name a few).
I looked at the source and tried to understand your recipe deriving algorithm. While doing that I refactored it, so I could understand it. The result is in this PR in the hope that you find it useful. Your source had a lot of code duplication I managed to reduce it by three quarters! Don't be afraid by the number of commits, most commits are very small and usually do only one thing. I don't recount what they do, please see the individual commit messages for that.
While doing the refactor I also fixed some bugs lurking in the code, e.g. handle all cases of normal, expensive ingredients, results, check both abc.name and abc[1] for the name of the item/recipe/ingredient, etc.
Beyond that I altered the algorithm in the following way (which might or might not count as bugs):
bef7d2fecac07c86abf6cfbe286b5e8f4d44a7f1 : Do not modify the hidden or enabled attribute of recipes. The recipe in question should already be set up properly. Also note that those attributes can be in three different locations (like ingredients), so setting them requires some code!
c25080504baa57dca113aa21c95eccc12a66e910 : the basic variant of the algorithm also checks expensive recipes (previously they were ignored)
a596677e7b608ea8fd0d9cbf8150ef17a1da900b : Support resources with multiple results (not sure if this was an oversight or intentional)
9881197a8a85e5585c732641937c54441bbf9325 , 7d1d7d51e2c42cbb0e3b50dc69b9fc6a0ccd94b3 : Allow the empty string as algorithm search keyword. An empty string is interpreted as "match any recipe". With this we can set the algorithm keywords to "" (empty) and the algorithm mode to basic and then all smelting recipes get duplicated for the heat furnace. (A good default in my opinion as the heat furnace is now a drop in for the steel furnace, but that is your decision to make.)
\
I also added a changelog entry for this as that is something the users might be interested in knowing. Also note that I elaborated this in the tool tip explanation, so this probably needs some retranslation by your translators.
a414263f08c70834870c22c0d97f8b45b3bb9065 , a9aff8ca971d99f9d52cde525757ed37bc436d5e : As mentioned above, I play with brevven's mod an also bismuth. They do modify some smelting recipes in their data-final-fixes phase. To properly copy these recipes our data-final-fixes.lua must run after theirs. The easiest way to ensure this is making those mods a (hidden) optional dependency.
\
In my test this also had the side effect that now our graphite item "wins" the data phase race resulting in changed graphics (previously they won because Atomic_Overhaul comes before bzcarbon). To mitigate this, I modified our graphite item to be only added if there is not already one. (This seems to be good practice anyway).
Hi there,
I like your mod ... however the heat furnace did not work at all with brevven's mods (bztitanium, bzcarbon, ...). It was missing all recipes (aluminum plate, tin plate, to name a few).
I looked at the source and tried to understand your recipe deriving algorithm. While doing that I refactored it, so I could understand it. The result is in this PR in the hope that you find it useful. Your source had a lot of code duplication I managed to reduce it by three quarters! Don't be afraid by the number of commits, most commits are very small and usually do only one thing. I don't recount what they do, please see the individual commit messages for that.
While doing the refactor I also fixed some bugs lurking in the code, e.g. handle all cases of
normal
,expensive
ingredients, results, check bothabc.name
andabc[1]
for the name of the item/recipe/ingredient, etc.Beyond that I altered the algorithm in the following way (which might or might not count as bugs):
bef7d2fecac07c86abf6cfbe286b5e8f4d44a7f1 : Do not modify the
hidden
orenabled
attribute of recipes. The recipe in question should already be set up properly. Also note that those attributes can be in three different locations (like ingredients), so setting them requires some code!c25080504baa57dca113aa21c95eccc12a66e910 : the basic variant of the algorithm also checks
expensive
recipes (previously they were ignored)a596677e7b608ea8fd0d9cbf8150ef17a1da900b : Support resources with multiple results (not sure if this was an oversight or intentional)
9881197a8a85e5585c732641937c54441bbf9325 , 7d1d7d51e2c42cbb0e3b50dc69b9fc6a0ccd94b3 : Allow the empty string as algorithm search keyword. An empty string is interpreted as "match any recipe". With this we can set the algorithm keywords to "" (empty) and the algorithm mode to basic and then all smelting recipes get duplicated for the heat furnace. (A good default in my opinion as the heat furnace is now a drop in for the steel furnace, but that is your decision to make.) \ I also added a changelog entry for this as that is something the users might be interested in knowing. Also note that I elaborated this in the tool tip explanation, so this probably needs some retranslation by your translators.
a414263f08c70834870c22c0d97f8b45b3bb9065 , a9aff8ca971d99f9d52cde525757ed37bc436d5e : As mentioned above, I play with brevven's mod an also bismuth. They do modify some smelting recipes in their data-final-fixes phase. To properly copy these recipes our data-final-fixes.lua must run after theirs. The easiest way to ensure this is making those mods a (hidden) optional dependency. \ In my test this also had the side effect that now our graphite item "wins" the data phase race resulting in changed graphics (previously they won because Atomic_Overhaul comes before bzcarbon). To mitigate this, I modified our graphite item to be only added if there is not already one. (This seems to be good practice anyway).
Have fun!