diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-10-08 20:33:01 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-10-08 20:33:01 -0400 |
commit | 8d6670cfc8abf7e71197d2f621314fb04a0543b8 (patch) | |
tree | 73594cd0fe3dd7ee137dd7e538d8eaa218601b35 /src/SMAPI | |
parent | a565ac9405a95d24f7cf945228935107e91bb89f (diff) | |
download | SMAPI-8d6670cfc8abf7e71197d2f621314fb04a0543b8.tar.gz SMAPI-8d6670cfc8abf7e71197d2f621314fb04a0543b8.tar.bz2 SMAPI-8d6670cfc8abf7e71197d2f621314fb04a0543b8.zip |
pass mod info to GetApi instead
Diffstat (limited to 'src/SMAPI')
-rw-r--r-- | src/SMAPI/Framework/ModHelpers/ModRegistryHelper.cs | 2 | ||||
-rw-r--r-- | src/SMAPI/IMod.cs | 6 | ||||
-rw-r--r-- | src/SMAPI/Mod.cs | 2 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/SMAPI/Framework/ModHelpers/ModRegistryHelper.cs b/src/SMAPI/Framework/ModHelpers/ModRegistryHelper.cs index 8cc73481..93edd597 100644 --- a/src/SMAPI/Framework/ModHelpers/ModRegistryHelper.cs +++ b/src/SMAPI/Framework/ModHelpers/ModRegistryHelper.cs @@ -85,7 +85,7 @@ namespace StardewModdingAPI.Framework.ModHelpers { try { - api = mod.Mod?.GetApi(this.Mod.Manifest); + api = mod.Mod?.GetApi(this.Mod); if (api != null && !api.GetType().IsPublic) { api = null; diff --git a/src/SMAPI/IMod.cs b/src/SMAPI/IMod.cs index 4576246a..19d01311 100644 --- a/src/SMAPI/IMod.cs +++ b/src/SMAPI/IMod.cs @@ -24,14 +24,14 @@ namespace StardewModdingAPI void Entry(IModHelper helper); /// <summary>Get an <a href="https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Integrations">API that other mods can access</a>. This is always called after <see cref="Entry"/>, and is only called once even if multiple mods access it.</summary> - /// <remarks>You can implement <see cref="GetApi()"/> to provide one instance to all mods, or <see cref="GetApi(IManifest)"/> to provide a separate instance per mod. These are mutually exclusive, so you can only implement one of them.</remarks> + /// <remarks>You can implement <see cref="GetApi()"/> to provide one instance to all mods, or <see cref="GetApi(IModInfo)"/> to provide a separate instance per mod. These are mutually exclusive, so you can only implement one of them.</remarks> /// <remarks>Returns the API instance, or <c>null</c> if the mod has no API.</remarks> object? GetApi(); /// <summary>Get an <a href="https://stardewvalleywiki.com/Modding:Modder_Guide/APIs/Integrations">API that other mods can access</a>. This is always called after <see cref="Entry"/>, and is called once per mod that accesses the API (even if they access it multiple times).</summary> - /// <param name="manifest">The manifest for the mod accessing the API.</param> + /// <param name="mod">The mod accessing the API.</param> /// <remarks>Returns the API instance, or <c>null</c> if the mod has no API. Note that the manifest is provided for informational purposes only, and that denying API access to specific mods is strongly discouraged and may be considered abusive.</remarks> /// <inheritdoc cref="GetApi()" include="/Remarks" /> - object? GetApi(IManifest manifest); + object? GetApi(IModInfo mod); } } diff --git a/src/SMAPI/Mod.cs b/src/SMAPI/Mod.cs index 1a5f5594..01157886 100644 --- a/src/SMAPI/Mod.cs +++ b/src/SMAPI/Mod.cs @@ -31,7 +31,7 @@ namespace StardewModdingAPI } /// <inheritdoc /> - public virtual object? GetApi(IManifest manifest) + public virtual object? GetApi(IModInfo mod) { return null; } |