diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-08-08 00:24:20 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2021-08-08 00:24:20 -0400 |
commit | 976c66537c9f4493ce859c574675bb8651b5323f (patch) | |
tree | 1e16747a1f78e10baf68171140d9bb06f20aeb72 /src/SMAPI/Framework/ModLoading | |
parent | 885808fb66233caf3057f0baa6368f4763a8eade (diff) | |
download | SMAPI-976c66537c9f4493ce859c574675bb8651b5323f.tar.gz SMAPI-976c66537c9f4493ce859c574675bb8651b5323f.tar.bz2 SMAPI-976c66537c9f4493ce859c574675bb8651b5323f.zip |
fix edge case where Netcode references aren't rewritten correctly
Diffstat (limited to 'src/SMAPI/Framework/ModLoading')
-rw-r--r-- | src/SMAPI/Framework/ModLoading/AssemblyDefinitionResolver.cs | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/SMAPI/Framework/ModLoading/AssemblyDefinitionResolver.cs b/src/SMAPI/Framework/ModLoading/AssemblyDefinitionResolver.cs index aefb0126..b3415609 100644 --- a/src/SMAPI/Framework/ModLoading/AssemblyDefinitionResolver.cs +++ b/src/SMAPI/Framework/ModLoading/AssemblyDefinitionResolver.cs @@ -21,11 +21,17 @@ namespace StardewModdingAPI.Framework.ModLoading public void Add(params AssemblyDefinition[] assemblies) { foreach (AssemblyDefinition assembly in assemblies) - { - this.RegisterAssembly(assembly); - this.Lookup[assembly.Name.Name] = assembly; - this.Lookup[assembly.Name.FullName] = assembly; - } + this.Add(assembly, assembly.Name.Name, assembly.Name.FullName); + } + + /// <summary>Add known assemblies to the resolver.</summary> + /// <param name="assembly">The assembly to add.</param> + /// <param name="names">The assembly names for which it should be returned.</param> + public void Add(AssemblyDefinition assembly, params string[] names) + { + this.RegisterAssembly(assembly); + foreach (string name in names) + this.Lookup[name] = assembly; } /// <summary>Resolve an assembly reference.</summary> |