You are viewing a potentially older version of this package. View all versions.
DrakeMods-DrakeModsLibs-0.9.4 icon

DrakeModsLibs

Shared DrakeMods library for Valheim - ArtItemLoader, display patches, tags, APIs, and server config sync. Required by LockSmith and DrakesRenameit. Valheim 1.0 compatible.

Date uploaded 2 days ago
Version 0.9.4
Download link DrakeMods-DrakeModsLibs-0.9.4.zip
Downloads 111
Dependency string DrakeMods-DrakeModsLibs-0.9.4

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2333 icon
denikson-BepInExPack_Valheim

BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.

Preferred version: 5.4.2333
ValheimModding-Jotunn-2.29.0 icon
ValheimModding-Jotunn

Jötunn (/ˈjɔːtʊn/, 'giant'), the Valheim Library was created with the goal of making the lives of mod developers easier. It enables you to create mods for Valheim using an abstracted API so you can focus on the actual content creation.

Preferred version: 2.29.0

README

DrakeModsLibs icon

DrakeModsLibs

Shared library for DrakeMods Valheim mods. It owns the display Harmony patches, item custom-data helpers, tag gatekeeping, menu binding registry, and server config sync so feature mods stay smaller and stay compatible when the game updates.

DrakeModsLibs is published on its own so other DrakeMods (starting with DrakesRenameit) can depend on one common package. More customization-oriented mods may use it later; there is no full suite planned for release right now — priorities and a redesign pass come first. Reskin is something we still want to look into when time allows.

Valheim 1.0

This release targets Valheim 1.0 API changes (notably item-stand visual updates and related display paths). Install the matching DrakeModsLibs build with your feature mods so labels and hover text keep working after the 1.0 update.

Required for

  • LockSmith (ArtItemLoader for the Locksmith Key pack)
  • DrakesRenameit (and any future DrakeMods that share display / config sync)

Art items (ArtItemLoader)

Consumer mods call ArtItemLoader.Register(log, pluginDir, config, customize) from Awake. Layouts:

  • Folder pack: Assets/Items/keys/keys.bundle + masterkey.json / masterkey.png (shared bundle, many items)
  • Legacy: Assets/Items/<id>/item.json + art.bundle

Optional customize can set name, recipe, scale, materials, or UseDonorVisual (keep CryptKey mesh, retint only).

Server config sync (DrakeConfigSync)

Only DrakeModsLibs references and ILRepack-embeds ServerSync. Consumer mods must not add a ServerSync Thunderstore dependency or ILRepack step.

At startup, create sync via the API:

var sync = CustomizeLibsAPI.CreateConfigSync(modId, displayName, version);
var entry = sync.BindSynced(config, section, configurationManagerCategory, key, defaultValue, description);
sync.AddLockingConfigEntry(lockEntry);
sync.FinalizeBinding(log, expectedSyncedEntryCount, () => lockEntry.Value);

Use BindClientOnly for per-client settings (never registered with ServerSync). IsSourceOfTruth / SourceOfTruthChanged behave like the underlying ServerSync instance.

Custom data API (other mods)

Read and dump ItemDrop.ItemData.m_customData through CustomizeLibsAPI:

  • GetCustomDataValue(item, key) — display value (tags → true/null, text → stored string)
  • GetCustomDataRaw(item, key) — raw dictionary value
  • DumpItemCustomData(item, options) — all keys, one mod, one key, JSON or neat text
  • DumpAllDrakeCustomData(item) / DumpItemCustomDataForMod(item, modId)
  • RegisterModCustomDataFields(modId, fields) — register your mod’s keys at startup

Built-in mod ids: DrakesRenameIt, DrakeModsLibs, DrakesQuestItems, DrakesItemShop.

Subscribe to CustomizationEvents.OnItemNameChanged for rename logging; use DrakeCustomDataKeys.Rename with GetCustomDataValue.

Tag gates (RenameIt integration)

Other mods talk to Libs only; RenameIt calls CanPerform / IsRenameInventorySuppressed and never needs a new release for your tags.

Built-in tag Blocks Inventory UI Admin bypass
Drake_NoRename rename suppress soft (yes)
Drake_NoDesc description soft (yes)
Drake_NoCraftedByEdit crafted-by soft (yes)
Drake_QuestItem all edits suppress soft (yes)
Drake_HardNoRename rename suppress hard (no)
Drake_HardNoDesc description suppress hard (no)
Drake_HardNoCraftedBy crafted-by suppress hard (no)
Drake_Immutable all edits suppress hard (no)
Deferred (DeferEditsTo) chosen ops optional authority decides
// Soft stamp (admin/VIP TagBypass may still allow)
CustomizeLibsAPI.BlockRename(item);

// Hard stamp (LockSmith-style safety — no admin bypass)
CustomizeLibsAPI.HardBlockRename(item);
// or
CustomizeLibsAPI.MarkImmutable(item);

// Deferred: owning mod is in charge (not never, not hard-never)
CustomizeLibsAPI.RegisterDeferredEditAuthority(
    "LockSmith",
    CustomizeOperation.RenameName | CustomizeOperation.RenameDescription,
    (item, player, op) => /* your policy */ true);

CustomizeLibsAPI.DeferEditsTo(
    item,
    "LockSmith",
    CustomizeOperation.RenameName,
    suppressRenameInventoryUi: true); // Relabel owns inventory menu

// Whole prefab family at startup (no per-drop stamp)
CustomizeLibsAPI.RegisterItemExclusion(
    "masterkey",
    CustomizeOperation.RenameName,
    suppressRenameInventoryUi: true,
    hardLock: true);

CustomizeLibsAPI.RegisterItemDeferral(
    "CryptKey",
    "LockSmith",
    CustomizeOperation.RenameName,
    suppressRenameInventoryUi: true);

// Custom tag rule at startup (RenameIt picks it up automatically)
CustomizeLibsAPI.RegisterTagBlockRule(
    "Drake_MyMod_LockBound",
    CustomizeOperation.RenameName,
    suppressRenameInventoryUi: true,
    hardLock: true);

Soft blocks still respect RenameIt admin/VIP TagBypass for CanPerform. Hard locks, deferred authority, and inventory UI suppress do not auto-apply bypass. Direct SetCustomName still works for an owning mod’s Relabel UI.

Shared wood UI + tab host

RenameIt-looking chrome lives in DrakeModsLibs.UI:

  • DrakeWoodActionMenu, DrakeConfirmPanel (300×178), DrakeTextPromptPanel
  • DrakeGuiInput / DrakeButtonSfx
  • DrakeTabHost — Craft|Upgrade-style top-right tabs; only registered (installed) mods get a tab. Rename baseline priority is low; feature mods claim default (e.g. Lock on keys). Defer/suppress hides Rename entirely.

Cross-mod knobs: BepInEx config section Integration (DrakeIntegrationConfig) — shared inventory open modifier, TabPriorityOverrides (id=priority;…), ForceDefaultTabId, DisableClaimDefault. Feature mods keep gameplay-only config.

Inventory open + hints (Libs): InventoryOpenModifier + right-click opens DrakeTabHost when any usable tab exists for the item (permission-aware IsAvailable). Yellow interact line:

  • 1 usable tab → that mod’s localized getHintPhrase (e.g. LockSmith “configure lock tool”, RenameIt “edit”)
  • 2+ usable → Libs localized customize Do not put those phrases in Libs — register getters from each feature mod. Tab strip appears only when usable count ≥ 2.

RenameIt handoff: Register tab renameit with your localized hint; IsAvailable must respect suppress and TagBypass (admin may get usable=2 on Locksmith keys). Drop competing “for options” tooltip/open once Libs consumes usable ≥ 1.

Install

  1. Install BepInEx and Jotunn (see Thunderstore dependencies).
  2. Install DrakeModsLibs.
  3. Install feature mods that depend on it (e.g. DrakesRenameit).

Team: DrakeMods · Contact: Drakethos (Discord / email in the RenameIt page).

Publishing (GitHub Actions)

Pushing a tag v{Version} that matches <Version> in mod.package.props runs .github/workflows/release.yml:

  1. Build the Thunderstore zip and create a GitHub Release with the zip attached
  2. Publish that zip to Thunderstore (DrakeMods-DrakeModsLibs)
  3. Publish the same zip to Hexium (valheim.hexium.gg) after Thunderstore succeeds

Repo secrets required:

Secret Source
THUNDERSTORE_TOKEN Thunderstore team service account for DrakeMods
HEXIUM_TOKEN Hexium team API token for DrakeMods (team settings)

CHANGELOG

DrakeModsLibs

0.9.4

  • Soft IsRenameInventorySuppressed respects admin/VIP TagBypass (hard suppress still always hides Rename inventory UI).
  • HardNoDescription / HardNoCraftedByEdit no longer set suppressRenameInventoryUi — they block those ops only, so Locksmith keys can show Lock|Rename tabs for bypass admins.
  • Shared Drake wood UI shell (RenameIt-standard): DrakeWoodActionMenu, DrakeConfirmPanel (300×178), DrakeTextPromptPanel, DrakeGuiInput, DrakeButtonSfx.
  • DrakeTabHost: Craft|Upgrade-style top-right tabs; Register / ClaimDefault / priority (Rename baseline low); Hide / NotifyFeatureClosed; CloseSilent on action menus. Missing mod = no tab.
  • Inventory context chord: Libs Integration.InventoryOpenModifier → open when any usable tab exists; dynamic interact hint (getHintPhrase / multi-mode customize token).
  • DrakeIntegrationConfig: umbrella Integration section — shared open modifier, tab priority overrides, force default tab, disable ClaimDefault.
  • Tag / edit gatekeeper: rule-driven IsRenameInventorySuppressed; hard locks; deferred edit authority; soft stamp helpers; prefab/family exclusions and deferrals.

0.9.3

  • Fix Valheim 1.0 pickup/drop HUD: Character.Message / Player.Message take a fifth bool log argument. Old 4-arg calls threw MissingMethodException on every pickup.

0.9.2

  • ArtItemLoader — register Asset Forge items from Assets/Items beside a consumer plugin (optional customize hook).
  • Folder packs: shared keys.bundle + per-item JSON/PNG (e.g. LockSmith masterkey), with process-lifetime AssetBundle path cache.
  • Legacy layout still supported: Assets/Items/<id>/item.json + art.bundle.
  • ArtItemContext.UseDonorVisual keeps the donor mesh and only retints materials when requested.

0.9.1

  • Item-stand hover labels load the attached item from the stand ZDO (durability and custom data) instead of the prefab, so names stay accurate without mutating ObjectDB.
  • CustomizeLibsAPI.RefreshItemStandDisplayNames recomputes stand labels immediately after name-modifier config changes.
  • Drake_PublicRewrite custom-data key for allowing non-owners to rewrite name/description.
  • DrakeConfigSync.BindSynced accepts Configuration Manager acceptable values.

0.9.0

  • First standalone Thunderstore-oriented package identity: DrakeModsLibs (com.drakemods.libs).
  • Shared library split out for DrakesRenameit and future DrakeMods consumers (no full suite release planned at this time).
  • Valheim 1.0 compatibility — display / item-stand Harmony paths updated for the 1.0 game API (fixes broken labels / stand visuals after the update).
  • DrakeConfigSync — wraps ServerSync ConfigSync for consumers (BindSynced, BindClientOnly, AddLockingConfigEntry, FinalizeBinding).
  • CustomizeLibsAPI.CreateConfigSync — public factory for other Drake mods.
  • ILRepack — ServerSync embedded/internalized into DrakeModsLibs.dll (only this mod ships merged ServerSync).

0.3.0

  • DrakeConfigSync + CreateConfigSync + ILRepack ServerSync (pre-identity rename).

0.2.1

  • Display Harmony patches, name resolution pipeline, tag gatekeeper, menu binding registry, shared customization API.

0.1.0

  • Phase 1 scaffold: project template, CI, stub BepInEx plugin.