Multiple RecipeItem BugFix

v1.0.0·Updated 2025-02-23

A partial fix for a bug in **ItemManager** related to recipes with more than 4 items.

About this mod Author’s original text

WackyZ Multiple Item Recipe BugFix

Description: A partial fix for a bug in ItemManager related to recipes with more than 4 items.

Overview

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

The bug occurs in ItemManager when handling recipes with more than 4 items. Specifically:

  • Recipes with 5, 6, or 7 items do not cycle through their items correctly.
  • The issue stems from how ItemManager handles the cutoff for displaying up to 4 items, particularly when distinguishing between active and inactive requirements (e.g., items belonging to another upgrade level).

The problematic code in ItemManager can be found here:

ItemManager.cs Line 1095

The Fix

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.

Technical Details

  • The mod uses Harmony to unpatch the following method:

harmony.Unpatch(

AccessTools.DeclaredMethod(typeof(InventoryGui), nameof(InventoryGui.SetupRequirementList)),

HarmonyPatchType.Transpiler,

harmony.Id

);

  • This removes the transpiler patch applied by ItemManager, allowing recipes with more than 4 items to display correctly.

Limitations

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.

Future Improvements

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.

Credits

  • WackyMole: Mod creator and author of this fix.
  • blaxxun-boop: Original author of ItemManager.
  • HarmonyX: For providing the patching and unpatching functionality.

Support

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! 🛠️🐟

Install & use Install: BepInEx plugin

  1. The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
  2. Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
  3. Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
  4. Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.

Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file. In multiplayer, the host and every client need the same mods installed.

Dependencies

Install these first, or the mod will not work:

denikson-BepInExPack_Valheim

File & checksum

Filename
Multiple_RecipeItem_BugFix-1.0.0.zip
File size
39.9 KiB