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.
ModelReplacementAPIHotfix
Hotfix for ModelReplacementAPI 2.4.19: fixes held item slot errors and disables MoreCompany cosmetics on model replacements.
By abooban1
| Last updated | 4 hours ago |
| Total downloads | 24 |
| Total rating | 1 |
| Categories | Client-side Suits Emotes Bug Fixes |
| Dependency string | abooban1-ModelReplacementAPIHotfix-1.0.2 |
| Dependants | 0 other packages depend on this package |
This mod requires the following mods to function
BepInEx-BepInExPack
BepInEx pack for Mono Unity games. Preconfigured and ready to use.
Preferred version: 5.4.2100README
ModelReplacementAPI Hotfix
A small compatibility hotfix for ModelReplacementAPI 2.4.19 in Lethal Company. Imporved compatibility with MoreCompany cosmetics.
This mod is intended for modpacks where the original BunyaPineTree-ModelReplacementAPI is still required by other model replacement mods, but causes errors on newer Lethal Company versions or with reserved/item slot mods.
What this fixes
This hotfix currently addresses several common issues:
- Fixes
IndexOutOfRangeExceptioninLocateHeldObjectsOnModelReplacementPatch.LateUpdatePatch. - Adds safer held-item slot handling when
currentItemSlotpoints outside the vanillaItemSlotsarray. - Prevents repeated
NullReferenceExceptionspam fromBodyReplacementBase.LateUpdate. - Disables unsafe MoreCompany cosmetic rendering on players using model replacement skins.
- Helps prevent log spam when switching between incompatible model replacement suits.
Why this is needed
The original ModelReplacementAPI 2.4.19 assumes that the player's selected item slot always exists inside the vanilla ItemSlots array.
With newer Lethal Company versions and mods such as reserved hotbar/item slot mods, currentItemSlot may point to a reserved/tool slot outside the normal item slot array. This can cause errors like:
IndexOutOfRangeException
ModelReplacement.Patches.LocateHeldObjectsOnModelReplacementPatch.LateUpdatePatch