ReefPacksAzuUIFix

v1.0.2·Updated 2026-09-13

UI-only compatibility for worn ReefPacks material counts in AzuCraftyBoxes 1.8.18. Does not change consumption.

About this mod Author’s original text

ReefPacksAzuUIFix 1.0.2

Direct final-text compatibility patch for ReefPacks + AzuCraftyBoxes. Replaces the unsuccessful 1.0.0/1.0.1 UI-bank approach.

Installation

Close Valheim. Replace the old ReefPacksAzuUIFix.dll in your active profile's BepInEx/plugins/ReefPacksAzuUIFix/ folder with the new DLL. Keep only one copy of this plugin. Restart Valheim and view the Hammer recipe. This release has not been installed into your profile automatically.

The release zip uses layout. Source and build scripts are provided separately. Version 1.0.2 can be uploaded as an update under the same team/package.

What changed

The plugin now patches only InventoryGui.SetupRequirement, with a Harmony POSTFIX marked [HarmonyPriority(Priority.Last)] and [HarmonyAfter("Azumatt.AzuCraftyBoxes")]. Registration also orders it after the other owners already present on that method. Other Harmony owners are allowed. Mods installed later with conflicting explicit ordering, or separate UI refresh paths, cannot be guaranteed to run before this patch.

It finds elementRoot.transform.Find("res_amount"), obtains TextMeshProUGUI, reads the resource shared name from Piece.Requirement, and adds the worn ReefPack count to the displayed available numerator. The denominator is preserved. Examples:

  • 0/3 + 37 Wood -> 37/3
  • 10/3 + 37 Wood -> 47/3
  • 0/2 + 40 Stone -> 40/2

When the corrected count meets the displayed requirement, the component color becomes white. Otherwise Azu's existing color remains. Only text.text and text.color are written. No return value, recipe, inventory, eligibility state, consumption method, container list or UI-bank cache is changed. No UiItemBank methods are patched or invoked. No binary hashes or owner allowlists are used.

This is the explicitly requested additive display correction. It assumes Azu's displayed numerator excludes the ReefPack. It does not query containers to determine whether a future Azu release already includes the pack. If native integration starts including it, disable this compatibility plugin to avoid counting it twice. Azu's abbreviated K/M numerator can be parsed, but the original abbreviated count is already rounded, so the resulting sum is approximate. Unsupported custom formats are left unchanged and logged.

Equipped-pack access

Uses the inspected ReefPacks PackUi.WornPack(Player) method, which reads the local player's shoulder equipment reference and recognizes ReefPack items. Only that exact item's existing PackData.cache entry is accessed through TryGetValue; PackData.Item identity is checked and PackData.Inv is read. No carried-pack scanning, main-inventory membership assumption or frame-cache check is performed. Item matching uses the shared name and Valheim's world-level filter.

Never calls PackData.Get, because it can initialize, resize, save or eject items. An unavailable cache entry contributes zero and produces a diagnostic. Missing dependencies/API signatures prevent registration; runtime nulls or exceptions skip only the individual UI element and future elements retry.

Configuration and diagnostic session

BepInEx/config/local.ReefPacksAzuUIFix.cfg:

[General]

Enabled = true

DiagnosticLogging = true

Logging is enabled for testing. Repeated identical messages are suppressed; changing results are logged, up to 200 messages each launch. Disable DiagnosticLogging after the test. Startup reports both dependencies and successful InventoryGui.SetupRequirement registration. Expected messages:

SetupRequirement postfix executed

SetupRequirement $item_wood original=0/3 pack=37 corrected=37/3; read worn pack

SetupRequirement $item_stone original=0/2 pack=40 corrected=40/2; read worn pack

Read BepInEx/LogOutput.log or Valheim's Player.log after opening the Hammer recipe. These diagnostics distinguish missing pack data, an unsupported text format and successful correction later overwritten by another UI path. Errors do not disable the entire session.

Build and tests

Built against

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_Valheimfedorovdgap-AzuCraftyBoxesReefTeam-ReefPacks

File & checksum

Filename
ReefPacksAzuUIFix-1.0.2.zip
File size
14.3 KiB