Ishigh1 / RecursiveCraft

MIT License
4 stars 1 forks source link

KeyNotFoundException when opening the magic storage crafting interface with calamity's potion of cadance open #6

Open sdegueldre opened 3 years ago

sdegueldre commented 3 years ago
System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at RecursiveCraft.RecursiveSearch.UseExistingIngredients(IEnumerable`1 ingredientList, Int32& ingredientsNeeded, Int32& trueIngredientsNeeded) in RecursiveCraft\RecursiveSearch.cs:line 185
   at RecursiveCraft.RecursiveSearch.CraftableAmount(Recipe recipe, Int32 amount, Int32 trueAmount, List`1 forbiddenItems) in RecursiveCraft\RecursiveSearch.cs:line 93
   at RecursiveCraft.RecursiveSearch.UseIngredientFromRecipe(List`1 newForbiddenItems, Int32 validItem, Int32& ingredientsNeeded, Int32& trueIngredientsNeeded) in RecursiveCraft\RecursiveSearch.cs:line 141
   at RecursiveCraft.RecursiveSearch.CraftableAmount(Recipe recipe, Int32 amount, Int32 trueAmount, List`1 forbiddenItems) in RecursiveCraft\RecursiveSearch.cs:line 102
   at RecursiveCraft.RecursiveSearch.UseIngredientFromRecipe(List`1 newForbiddenItems, Int32 validItem, Int32& ingredientsNeeded, Int32& trueIngredientsNeeded) in RecursiveCraft\RecursiveSearch.cs:line 141
   at RecursiveCraft.RecursiveSearch.CraftableAmount(Recipe recipe, Int32 amount, Int32 trueAmount, List`1 forbiddenItems) in RecursiveCraft\RecursiveSearch.cs:line 102
   at RecursiveCraft.RecursiveSearch.FindIngredientsForRecipe(Recipe recipe, Int32 timeCraft) in RecursiveCraft\RecursiveSearch.cs:line 34
   at MagicStorageExtra.RecursiveCraftIntegration.SingleSearch(RecursiveSearch recursiveSearch, Recipe recipe) in MagicStorageExtra\RecursiveCraftIntegration.cs:line 145
   at MagicStorageExtra.RecursiveCraftIntegration.RecursiveRecipes() in MagicStorageExtra\RecursiveCraftIntegration.cs:line 109
   at MagicStorageExtra.CraftingGUI.RefreshRecipes(HashSet`1 hiddenRecipes, HashSet`1 craftedRecipes, HashSet`1 favorited) in MagicStorageExtra\CraftingGUI.cs:line 1098
   at MagicStorageExtra.CraftingGUI.<>c__DisplayClass144_0.<RefreshItems>b__1() in MagicStorageExtra\CraftingGUI.cs:line 917
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
   at System.Threading.Tasks.Task.ExecutionContextCallback(Object obj)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)
   at System.Threading.Tasks.Task.ExecuteEntry(Boolean bPreventDoubleExecution)
   at System.Threading.Tasks.Task.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()

Mod list:

[
  "CalamityModMusic",
  "CalamityMod",
  "WheresMyItems",
  "SmartDoors",
  "VeinMiner",
  "MagicStorageExtra",
  "CalValEX",
  "OmniSwing",
  "RecursiveCraft"
]

This shows up in the chat but doesn't crash the game and everything keeps working normally after that. I wasn't sure whether I should report this to you or to magic storage so I've done both. Here is the corresponding Magic Storage issue: https://github.com/ExterminatorX99/MagicStorage/issues/30

Ishigh1 commented 3 years ago

I found what caused the issue, it's from this mod, but I can't solve it in 1.3 without wasting the performances

sdegueldre commented 3 years ago

Thanks for looking into it, do you expect that the issue might be possible to solve once 1.4 is ready? Is there a way I can mitigate the issue in game in the mean time?

Ishigh1 commented 3 years ago

I already wrote the code for 1.4, an issue on this branch needs to be fixed in order to test it... To mitigate it ? The blood orb is the item causing the issue by being in all the potions recipe, so to avoid it, you could remove any blood orb from your storage while making potions that needs other potions

sdegueldre commented 3 years ago

Thanks a lot for your help!