

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.
This hotfix currently addresses several common issues:
IndexOutOfRangeException in LocateHeldObjectsOnModelReplacementPatch.LateUpdatePatch.currentItemSlot points outside the vanilla ItemSlots array.NullReferenceException spam from BodyReplacementBase.LateUpdate.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