NOTE: PlatoTK, which this mod depends on, is currently incompatible with SMAPI 3.12. This mod will start working with SMAPI 3.12 once PlatoTK is updated beyond 1.9.3.
Something curious happens when launching the game. The SMAPI console informs me in red that
[Flower Bombs] This mod failed in the GameLoop.GameLaunched event. Technical details: System.Exception: Harmony instance kdau.FlowerBombs failed applying postfix to method StardewValley.Item.drawAttachments. ---> InvalidProgramException: Common Language Runtime detected an invalid program. at System.Runtime.CompilerServices.RuntimeHelpers._PrepareMethod(IRuntimeMethodInfo method, IntPtr* pInstantiation, Int32 cInstantiation) at MonoMod.RuntimeDetour.Platforms.DetourRuntimeILPlatform.PrepareMethod(MethodBase method, RuntimeMethodHandle handle) at MonoMod.RuntimeDetour.Platforms.DetourRuntimeILPlatform.<>c__DisplayClass24_0.<Pin>b__0(MethodBase m) at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory) at MonoMod.RuntimeDetour.Platforms.DetourRuntimeILPlatform.Pin(MethodBase method) at MonoMod.RuntimeDetour.DetourHelper.Pin[T](T method) at HarmonyLib.MethodPatcher.CreateReplacement(Dictionary`2& finalInstructions) at HarmonyLib.PatchFunctions.UpdateWrapper(MethodBase original, PatchInfo patchInfo) at HarmonyLib.PatchProcessor.Patch() at StardewModdingAPI.Framework.ModLoading.RewriteFacades.HarmonyInstanceFacade.Patch(MethodBase original, HarmonyMethod prefix, HarmonyMethod postfix, HarmonyMethod transpiler) in SMAPI\Framework\ModLoading\RewriteFacades\HarmonyInstanceFacade.cs:line 36 --- End of inner exception stack trace --- at StardewModdingAPI.Framework.ModLoading.RewriteFacades.HarmonyInstanceFacade.Patch(MethodBase original, HarmonyMethod prefix, HarmonyMethod postfix, HarmonyMethod transpiler) in SMAPI\Framework\ModLoading\RewriteFacades\HarmonyInstanceFacade.cs:line 49 at FlowerBombs.FlowerBomb.Register() in /home/kevin/doc/projects/stardew/FlowerBombs/src/FlowerBomb.cs:line 87 at FlowerBombs.ModEntry.onGameLaunched(Object _sender, GameLaunchedEventArgs _e) in /home/kevin/doc/projects/stardew/FlowerBombs/src/ModEntry.cs:line 85 at StardewModdingAPI.Framework.Events.ManagedEvent`1.Raise(TEventArgs args, Func`2 match) in SMAPI\Framework\Events\ManagedEvent.cs:line 126
However, once the game starts, the flower bombs can be crafted, placed, etc, without any issue. Any idea what is causing the SMAPI error? I have the latest SMAPI, PlatoTK, etc.
Hmm. I've just confirmed that a Flower Bombs wouldn't directly replace any Truffles in its range when it germinates. However, if a Flower Bomb placed on the farm spawns weeds, those weeds have a chance of spreading and damaging other items overnight, just like weeds that spawn naturally on the farm. If you got the message "The spreading weeds have caused damage to your farm." one morning, that is likely what happened. Otherwise we could look at interactions with other mods you have installed, though I took a quick look at the list from your last log and didn't see any likely candidates.
I really have no idea whats going on xD but it is still happening even if I have your mod out. But I legit watch my pigs and instead of dropping truffles they drop weeds and I have no idea where to even start looking for the issue. At this point I'm just laughing
Very strange! I checked the Pig's code, and it directly identifies Truffles by object ID (430). So either one of your other mods is patching over the object data for 430/Truffle to be weeds instead, or is actually replacing the objects as soon as they spawn. I would suggest "harvesting" one of them and making sure that it behaves like a weed and not a truffle (since it might just be a graphical error). In any case, you'll have to try turning off different (groups of) mods until your pigs learn how to forage again. xD Good luck!
12 comments
[Flower Bombs] This mod failed in the GameLoop.GameLaunched event. Technical details:
System.Exception: Harmony instance kdau.FlowerBombs failed applying postfix to method StardewValley.Item.drawAttachments.
---> InvalidProgramException: Common Language Runtime detected an invalid program.
at System.Runtime.CompilerServices.RuntimeHelpers._PrepareMethod(IRuntimeMethodInfo method, IntPtr* pInstantiation, Int32 cInstantiation)
at MonoMod.RuntimeDetour.Platforms.DetourRuntimeILPlatform.PrepareMethod(MethodBase method, RuntimeMethodHandle handle)
at MonoMod.RuntimeDetour.Platforms.DetourRuntimeILPlatform.<>c__DisplayClass24_0.<Pin>b__0(MethodBase m)
at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
at MonoMod.RuntimeDetour.Platforms.DetourRuntimeILPlatform.Pin(MethodBase method)
at MonoMod.RuntimeDetour.DetourHelper.Pin[T](T method)
at HarmonyLib.MethodPatcher.CreateReplacement(Dictionary`2& finalInstructions)
at HarmonyLib.PatchFunctions.UpdateWrapper(MethodBase original, PatchInfo patchInfo)
at HarmonyLib.PatchProcessor.Patch()
at StardewModdingAPI.Framework.ModLoading.RewriteFacades.HarmonyInstanceFacade.Patch(MethodBase original, HarmonyMethod prefix, HarmonyMethod postfix, HarmonyMethod transpiler) in SMAPI\Framework\ModLoading\RewriteFacades\HarmonyInstanceFacade.cs:line 36
--- End of inner exception stack trace ---
at StardewModdingAPI.Framework.ModLoading.RewriteFacades.HarmonyInstanceFacade.Patch(MethodBase original, HarmonyMethod prefix, HarmonyMethod postfix, HarmonyMethod transpiler) in SMAPI\Framework\ModLoading\RewriteFacades\HarmonyInstanceFacade.cs:line 49
at FlowerBombs.FlowerBomb.Register() in /home/kevin/doc/projects/stardew/FlowerBombs/src/FlowerBomb.cs:line 87
at FlowerBombs.ModEntry.onGameLaunched(Object _sender, GameLaunchedEventArgs _e) in /home/kevin/doc/projects/stardew/FlowerBombs/src/ModEntry.cs:line 85
at StardewModdingAPI.Framework.Events.ManagedEvent`1.Raise(TEventArgs args, Func`2 match) in SMAPI\Framework\Events\ManagedEvent.cs:line 126
However, once the game starts, the flower bombs can be crafted, placed, etc, without any issue. Any idea what is causing the SMAPI error? I have the latest SMAPI, PlatoTK, etc.