I want update a mod, but don't know how up update harmony 2.0
hfgenman0601 opened this issue ยท 4 comments
Hello everyone , sorry for bothering you here. Because of my nation's policy , I cannot visit reddit and discord for help. Maybe the only place I can askfor help is here.
I want update a mod "Tool Upgrade Cost".
I already get source from github and update Nuget Package, but latest SMAPI have updated to harmony 2.0.
I know nothing about harmony and a little about C#.
So I cannot update it by myselft.
Here is that mod's harmony code :
HarmonyInstance harmony = HarmonyInstance.Create(ModManifest.UniqueID); harmony.Patch( AccessTools.Method(typeof(Utility), "priceForToolUpgradeLevel"), new HarmonyMethod(typeof(ModEntry), nameof(Utility_priceForToolUpgradeLevel_prefix)) ); harmony.Patch( AccessTools.Method(typeof(Utility), "indexOfExtraMaterialForToolUpgrade"), new HarmonyMethod(typeof(ModEntry), nameof(Utility_indexOfExtraMaterialForToolUpgrade_prefix)) ); harmony.Patch( AccessTools.Method(typeof(Utility), "getBlacksmithUpgradeStock"), postfix:new HarmonyMethod(typeof(ModEntry), nameof(Utility_getBlacksmithUpgradeStock_postfix)) );
Could anyone tell me how to update these code? I really desire.
How to migrate to Harmony 2 is described on SDV wiki: https://stardewvalleywiki.com/Modding:Migrate_to_Harmony_2.0
Tool Upgrade Costs is still compatible according to the mod compatibility list, and the mod author is still active. Are you having issues with it?
I sent the author a message on Discord to let them know and see if they need any help updating it. If you want to try updating it yourself, the Migrate to Harmony 2.0 and Migrate to Stardew Valley 1.5.5 pages cover the main changes needed.
Yes, SMAPI Compatibility Page says ToolUpgradeCost mod was compatible .
But actually , when I try to upgrading tools , SMAPI console report many errors. I visit mod page, and this incompatible problem occur since SMAPI 3.12 ( before 2021 Nov).
I also link my SMAPI errorlog (https://smapi.io/log/21da3892c1ad4db29bcebde10d6990c1)
But the author doesn't update.And I cannot contact him via discord or reddit.
So that's why I try to update by myself.