namespace Harmony.InventoryRebirth { internal class InventoryPatches { [HarmonyPatch(typeof(Inventory))] [HarmonyPatch("PUBLIC_SLOTS")] [HarmonyPatch(MethodType.Getter)] public static class PUBLIC_SLOTSPatch { public static void Postfix(Inventory __instance, ref int __result ) { __result = 20; } } [HarmonyPatch(typeof(Inventory))] [HarmonyPatch("updateHoldingItem")] public class updateHoldingItem { public static bool Prefix(Inventory __instance, global::EntityAlive ___entity ) { //Log.Out("InventoryPatches-updateHoldingItem START"); if (___entity is EntityPlayer) { EntityPlayerLocal primaryPlayer = GameManager.Instance.World.GetPrimaryPlayer(); if (primaryPlayer != null && primaryPlayer.entityId == ___entity.entityId) { //Log.Out("InventoryPatches-updateHoldingItem ___entity: " + ___entity.EntityName); RebirthUtilities.checkCraftingProgression(__instance, ___entity); RebirthVariables.isCraftableItem = RebirthUtilities.IsCraftableItem(); } } return true; } } } }