ProjectE icon indicating copy to clipboard operation
ProjectE copied to clipboard

Incorrect EMC prediction

Open Apceniy opened this issue 3 years ago • 3 comments

Tickets that do not conform to this template will be closed without comment

Exact ProjectE version (do not say "latest", "latest on Curse", or similar): 1.16.5-PE1.0.1B

Exact Forge version: 36.1.0

Link to crash log (please use a paste site, do not attach the .txt or paste the log inline): No crash

Steps to reproduce:

  1. Remove EMC for the philosopher's stone

What I expected to happen: Conversion recipes such as iron to gold, coal to alchemical coal will still predict EMC because philosopher's stone isn't consumed when crafting

What happened instead: Result items no longer have EMC if not set in other ways

Apceniy avatar Jul 01 '21 18:07 Apceniy

Easiest fix might be to filter the IngredientMap for 0 entries here.

MaPePeR avatar Jul 01 '21 20:07 MaPePeR

I can't reproduce this by just removing the EMC of the philo stone, it seems to still have an EMC value regardless until I remove the EMC of all ways of creating it.

@MaPePeR It filters it here, but not here. Do you think I should still add the filter earlier as it may make it so it has to do less calculations as it gets further into the mapper or just leave it be? Also do you think the second linked spot should skip adding it as a "usage" for the ingredient if there is none? (Note: Those two aren't mutually exclusive as there are other places or custom mappers/jsons where a conversion may end up having a specified size of zero so we may as well handle it properly in the mapper as well like we do now)

pupnewfster avatar Dec 25 '21 02:12 pupnewfster

Adding the filter to the second spot sounds like a good idea to me, as it may indeed speed up the mapper and do less calculations.

Thinking about it again the most reliable way might be to filter the ingredientsWithAmount in the Conversion-Constructor? That should eliminate the check in both places and also cover setValueFromConversion, if I didn't miss anything.

Might also move the copying of the Map to that constructor, because it is missing from setValueFromConversion.

Thinking more about it: Is this loop correct? I think it should loop through the ingredients of oldConversion and not the ingredients of the new conversion.

MaPePeR avatar Jan 08 '22 19:01 MaPePeR