Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
InventoryChangedCompat
Restores the Inventory.Changed() overload removed in Valheim 1.0. Fixes mods that silently stop consuming crafting materials.
By soop_creater
| Last updated | a month ago |
| Total downloads | 79 |
| Total rating | 0 |
| Categories | Modpacks |
| Dependency string | soop_creater-InventoryChangedCompat-1.0.0 |
| Dependants | 1 other package depends on this package |
This mod requires the following mods to function
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.2350README
InventoryChangedCompat
발헤임 1.0에서 제거된 Inventory.Changed() 오버로드를 메모리상에서 복원하는 BepInEx 프리로더 패치입니다.
문제
발헤임 1.0에서 시그니처가 바뀌었습니다.
1.0 이전: void Inventory.Changed()
1.0.12: void Inventory.Changed(bool success, bool cheatedStateChanged)
무인자 버전이 삭제되면서, 이를 호출하는 구버전 모드들이 MissingMethodException을 던집니다.
Method not found: void .Inventory.Changed()
AzuCraftyBoxes에서는 이것이 재료 무한 복사로 이어집니다. 이 모드는 Player.ConsumeResources에
Prefix를 걸어 바닐라 차감을 막고 자체 로직으로 상자에서 재료를 빼는데, 그 과정에서 위 예외가 발생하면
catch 블록으로 빠진 뒤 false를 반환합니다. 결과적으로 바닐라 차감도 막히고 자체 차감도 실패해서
아이템만 생기고 재료는 그대로 남습니다.
동작
프리로더 단계에서 assembly_valheim의 Inventory 타입에 무인자 Changed()를 주입하고,
내부에서 Changed(false, false)를 호출하도록 연결합니다.
ldarg.0
ldc.i4.0 // success = false
ldc.i4.0 // cheatedStateChanged = false
call void Inventory::Changed(bool, bool)
ret
인자값은 바닐라의 아이템 제거 경로(Inventory.RemoveItem, RemoveOneItem, StackAll,
MoveAll, MoveItemToThis)가 모두 Changed(false, false)로 호출하는 것과 동일하게 맞췄습니다.
- DLL을 수정하지 않습니다. 메모리상에서만 동작하므로 모드 업데이트에 영향을 주지 않습니다.
- 이미 무인자
Changed()가 존재하면 아무것도 하지 않습니다. 제작자가 정식 대응하면 자동으로 비켜섭니다. AzuModsValheim1Compat과 함께 써도 됩니다. 서로 다른 멤버를 다룹니다.
영향받는 것으로 확인된 호출부 (AzuCraftyBoxes 1.8.15)
VanillaContainer.ProcessContainerInventory / .Save, BackpackContainer ×2,
GemBagContainer ×3, FireplaceInteractPatch.Prefix, Turret_UseItem_Patch.Prefix — 총 9곳.
화로에 장작 넣기, 발리스타 탄약 장전도 같은 예외로 실패합니다.
주의
제작자(Azumatt)의 정식 대응이 나오면 그것을 쓰는 것이 좋습니다. GitHub master에는 1.8.19까지 커밋되어 있으나 아직 Thunderstore에 배포되지 않았습니다. 이 패치는 그때까지의 임시 대응입니다.