Difference between revisions of "Modding:Migrate to Harmony 2.0"
Jump to navigation
Jump to search
Pathoschild (talk | contribs) (+ best practices) |
Pathoschild (talk | contribs) (→Basic changes: fix typo) |
||
Line 13: | Line 13: | ||
# Recompile the mod. | # Recompile the mod. | ||
− | That's it! Otherwise usage | + | That's it! Otherwise usage should be identical. Harmony 2.0.0 adds a number of new features; see the [https://harmony.pardeike.net official documentation] for more info. |
[[Category:Modding]] | [[Category:Modding]] |
Revision as of 02:46, 31 January 2020
This page is for modders. Players: see Modding:Mod compatibility instead.
This page explains how to update your mods for compatibility with Harmony 2.0.0. This only applies to mods which use Harmony directly; this is discouraged in most cases, isn't officially part of SMAPI's public API, and isn't subject to SMAPI's normal versioning policy.
Before you start
Make sure you follow best practices outlined in the Harmony guide. In particular, use the EnableHarmony
option (don't reference the Harmony DLL directly) and use the code API.
Basic changes
- Change
using Harmony;
tousing HarmonyLib;
. - Change
HarmonyInstance harmony = HarmonyInstance.Create("your mod id");
toHarmony harmony = new Harmony("your mod id");
. - Recompile the mod.
That's it! Otherwise usage should be identical. Harmony 2.0.0 adds a number of new features; see the official documentation for more info.