summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/ModRegistry.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Framework/ModRegistry.cs')
-rw-r--r--src/SMAPI/Framework/ModRegistry.cs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/SMAPI/Framework/ModRegistry.cs b/src/SMAPI/Framework/ModRegistry.cs
index e9ceb66e..5be33cb4 100644
--- a/src/SMAPI/Framework/ModRegistry.cs
+++ b/src/SMAPI/Framework/ModRegistry.cs
@@ -33,8 +33,14 @@ namespace StardewModdingAPI.Framework
public void Add(IModMetadata metadata)
{
this.Mods.Add(metadata);
- if (!metadata.IsContentPack)
- this.ModNamesByAssembly[metadata.Mod.GetType().Assembly.FullName] = metadata;
+ }
+
+ /// <summary>Track a mod's assembly for use via <see cref="GetFrom"/>.</summary>
+ /// <param name="metadata">The mod metadata.</param>
+ /// <param name="modAssembly">The mod assembly.</param>
+ public void TrackAssemblies(IModMetadata metadata, Assembly modAssembly)
+ {
+ this.ModNamesByAssembly[modAssembly.FullName] = metadata;
}
/// <summary>Get metadata for all loaded mods.</summary>