diff --git a/AbsorbentSoil/AbsorbentSoilMod.cs b/AbsorbentSoil/AbsorbentSoilMod.cs index 5a1f511..e7cf1ab 100644 --- a/AbsorbentSoil/AbsorbentSoilMod.cs +++ b/AbsorbentSoil/AbsorbentSoilMod.cs @@ -280,33 +280,34 @@ namespace AbsorbentSoil } } - [HarmonyPatch(typeof(GrowContainer), "SetRemainingSoilUses")] - internal static class GrowContainer_SetRemainingSoilUses_Patch + [HarmonyPatch(typeof(Pot), "OnPlantFullyHarvested")] + internal static class Pot_OnPlantFullyHarvested_Patch { - private static void Postfix(GrowContainer __instance, int uses) + private static void Prefix(Pot __instance) { try { - Pot pot = __instance.TryCast(); - if (pot == null) - return; - - SoilHelper.SetRemainingSoilUses(pot, uses); - - if (uses <= 0) - { - AdditiveMemory.Forget(pot); - SoilHelper.Forget(pot); - MelonLogger.Msg("[Absorbent Soil] Cleared retained additives because soil uses reached zero."); - } + MelonLogger.Msg($"Pot.OnPlantFullyHarvested fired. Pot={__instance?.name}, key={PotKeyHelper.GetPotKey(__instance)}"); } catch (Exception ex) { - MelonLogger.Warning($"SetRemainingSoilUses postfix failed: {ex}"); + MelonLogger.Warning($"OnPlantFullyHarvested prefix failed: {ex}"); + } + } + + private static void Postfix(Pot __instance) + { + try + { + MelonLogger.Msg($"Pot.OnPlantFullyHarvested postfix. Pot={__instance?.name}, key={PotKeyHelper.GetPotKey(__instance)}"); + } + catch (Exception ex) + { + MelonLogger.Warning($"OnPlantFullyHarvested postfix failed: {ex}"); } } } - + [HarmonyPatch(typeof(Plant), nameof(Plant.AdditiveApplied))] internal static class Plant_AdditiveApplied_Patch { diff --git a/AbsorbentSoil/bin/Release/net6.0/AbsorbentSoil.pdb b/AbsorbentSoil/bin/Release/net6.0/AbsorbentSoil.pdb index 30631ed..8438d23 100644 Binary files a/AbsorbentSoil/bin/Release/net6.0/AbsorbentSoil.pdb and b/AbsorbentSoil/bin/Release/net6.0/AbsorbentSoil.pdb differ diff --git a/AbsorbentSoil/obj/Release/net6.0/AbsorbentSoil.AssemblyInfo.cs b/AbsorbentSoil/obj/Release/net6.0/AbsorbentSoil.AssemblyInfo.cs index 01ec7f9..7d84c34 100644 --- a/AbsorbentSoil/obj/Release/net6.0/AbsorbentSoil.AssemblyInfo.cs +++ b/AbsorbentSoil/obj/Release/net6.0/AbsorbentSoil.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("AbsorbentSoil")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Release")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+edfdcd0f82cb8dd28ef7c23c0a6db9346d0297d7")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+fdf41b25678969e3fac301d7465f02226d5d3125")] [assembly: System.Reflection.AssemblyProductAttribute("AbsorbentSoil")] [assembly: System.Reflection.AssemblyTitleAttribute("AbsorbentSoil")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/AbsorbentSoil/obj/Release/net6.0/AbsorbentSoil.AssemblyInfoInputs.cache b/AbsorbentSoil/obj/Release/net6.0/AbsorbentSoil.AssemblyInfoInputs.cache index 33983fa..e70c97d 100644 --- a/AbsorbentSoil/obj/Release/net6.0/AbsorbentSoil.AssemblyInfoInputs.cache +++ b/AbsorbentSoil/obj/Release/net6.0/AbsorbentSoil.AssemblyInfoInputs.cache @@ -1 +1 @@ -7cd9882f4d02c82d4b4ffd99984e37f9ceb6e198918111ba41d9c687163e9fa9 +672b76dd04a707c049e964af103b4f06e1081fd0b4decdbfaad45890e1b78a75 diff --git a/AbsorbentSoil/obj/Release/net6.0/AbsorbentSoil.dll b/AbsorbentSoil/obj/Release/net6.0/AbsorbentSoil.dll index 99f2c52..865496c 100644 Binary files a/AbsorbentSoil/obj/Release/net6.0/AbsorbentSoil.dll and b/AbsorbentSoil/obj/Release/net6.0/AbsorbentSoil.dll differ diff --git a/AbsorbentSoil/obj/Release/net6.0/AbsorbentSoil.pdb b/AbsorbentSoil/obj/Release/net6.0/AbsorbentSoil.pdb index 30631ed..8438d23 100644 Binary files a/AbsorbentSoil/obj/Release/net6.0/AbsorbentSoil.pdb and b/AbsorbentSoil/obj/Release/net6.0/AbsorbentSoil.pdb differ diff --git a/AbsorbentSoil/obj/Release/net6.0/ref/AbsorbentSoil.dll b/AbsorbentSoil/obj/Release/net6.0/ref/AbsorbentSoil.dll index 0c537aa..bc6d904 100644 Binary files a/AbsorbentSoil/obj/Release/net6.0/ref/AbsorbentSoil.dll and b/AbsorbentSoil/obj/Release/net6.0/ref/AbsorbentSoil.dll differ diff --git a/AbsorbentSoil/obj/Release/net6.0/refint/AbsorbentSoil.dll b/AbsorbentSoil/obj/Release/net6.0/refint/AbsorbentSoil.dll index 0c537aa..bc6d904 100644 Binary files a/AbsorbentSoil/obj/Release/net6.0/refint/AbsorbentSoil.dll and b/AbsorbentSoil/obj/Release/net6.0/refint/AbsorbentSoil.dll differ