

Description: A partial fix for a bug in ItemManager related to recipes with more than 4 items.
This mod addresses a specific bug in ItemManager where recipes with more than 4 items (but not multiples of 4) fail to cycle through their items correctly. For example, recipes with 5, 6, or 7 items do not display properly. This issue is particularly noticeable in recipes like fish, which often have more than 4 ingredients.
This mod serves as a compromising bandaid rather than a complete fix. It removes a low-priority transpiler patch in ItemManager that ensures Valheim distinguishes between active and inactive requirements when displaying up to 4 items. While this patch is not critical, its removal resolves the display issue for recipes with more than 4 items.
The bug occurs in ItemManager when handling recipes with more than 4 items. Specifically:
The problematic code in ItemManager can be found here:
ItemManager.cs Line 1095
This mod works by unpatching a transpiler patch in ItemManager. The patch being removed is responsible for ensuring Valheim distinguishes between active and inactive requirements when displaying up to 4 items. While this patch is not critical, its removal resolves the display issue for recipes with more than 4 items.
harmony.Unpatch(
AccessTools.DeclaredMethod(typeof(InventoryGui), nameof(InventoryGui.SetupRequirementList)),
HarmonyPatchType.Transpiler,
harmony.Id
);
This mod is a partial fix and not a complete solution. It works around the issue by removing a low-priority patch in ItemManager, but it does not address the root cause of the bug. A proper fix would require deeper changes to ItemManager's code.
This mod is intended as a temporary solution until a proper fix is implemented in ItemManager. If you have the knowledge and skills to address the root cause of the bug, contributions are welcome! Please refer to the ItemManager GitHub repository for more details.
Disclaimer: This mod is provided as-is. Use at your own risk. The author is not responsible for any issues caused by this mod.
Enjoy your Valheim adventures with properly displayed recipes! ๐ ๏ธ๐