Upload from upload_mods.ps1
This commit is contained in:
43
Harmony/Harmony_Inventory.cs
Normal file
43
Harmony/Harmony_Inventory.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user