Confirmedusers
510
edits
(Made heading level more consistent with other pages) |
(→Basic Patching: prevent the patches from getting double applied) |
||
Line 26: | Line 26: | ||
public void Start(ICoreAPI api) { | public void Start(ICoreAPI api) { | ||
this.api = api; | this.api = api; | ||
harmony = new Harmony( | // The mod is started once for the server and once for the client. | ||
// Prevent the patches from being applied by both in the same process. | |||
if (!Harmony.HasAnyPatches(Mod.Info.ModID)) { | |||
harmony = new Harmony(Mod.Info.ModID); | |||
harmony.PatchAll(); // Applies all harmony patches | |||
} | |||
} | } | ||
// ... Harmony patch functions here | // ... Harmony patch functions here |