summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-01-22 21:05:04 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2021-01-22 21:05:04 -0500
commitd0dc3ea6f6d03e6aabdab5f5f10a60177f0e53b6 (patch)
tree02896d970c7650d8f7c8b84f54e53eddab88b4ca /src/SMAPI/Framework/ModLoading/AssemblyLoader.cs
parent5953fc3bd083ae0a579d2da1ad833e6163848086 (diff)
parent733750fdc4f5d16069d95880144619c0e31e8a89 (diff)
downloadSMAPI-d0dc3ea6f6d03e6aabdab5f5f10a60177f0e53b6.tar.gz
SMAPI-d0dc3ea6f6d03e6aabdab5f5f10a60177f0e53b6.tar.bz2
SMAPI-d0dc3ea6f6d03e6aabdab5f5f10a60177f0e53b6.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/Framework/ModLoading/AssemblyLoader.cs')
-rw-r--r--src/SMAPI/Framework/ModLoading/AssemblyLoader.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs
index 9fb5384e..4fae0f44 100644
--- a/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs
+++ b/src/SMAPI/Framework/ModLoading/AssemblyLoader.cs
@@ -37,6 +37,9 @@ namespace StardewModdingAPI.Framework.ModLoading
/// <summary>The objects to dispose as part of this instance.</summary>
private readonly HashSet<IDisposable> Disposables = new HashSet<IDisposable>();
+ /// <summary>Whether to rewrite mods for compatibility.</summary>
+ private readonly bool RewriteMods;
+
/*********
** Public methods
@@ -45,10 +48,12 @@ namespace StardewModdingAPI.Framework.ModLoading
/// <param name="targetPlatform">The current game platform.</param>
/// <param name="monitor">Encapsulates monitoring and logging.</param>
/// <param name="paranoidMode">Whether to detect paranoid mode issues.</param>
- public AssemblyLoader(Platform targetPlatform, IMonitor monitor, bool paranoidMode)
+ /// <param name="rewriteMods">Whether to rewrite mods for compatibility.</param>
+ public AssemblyLoader(Platform targetPlatform, IMonitor monitor, bool paranoidMode, bool rewriteMods)
{
this.Monitor = monitor;
this.ParanoidMode = paranoidMode;
+ this.RewriteMods = rewriteMods;
this.AssemblyMap = this.TrackForDisposal(Constants.GetAssemblyMap(targetPlatform));
// init resolver
@@ -308,7 +313,7 @@ namespace StardewModdingAPI.Framework.ModLoading
}
// find or rewrite code
- IInstructionHandler[] handlers = new InstructionMetadata().GetHandlers(this.ParanoidMode, platformChanged).ToArray();
+ IInstructionHandler[] handlers = new InstructionMetadata().GetHandlers(this.ParanoidMode, platformChanged, this.RewriteMods).ToArray();
RecursiveRewriter rewriter = new RecursiveRewriter(
module: module,
rewriteType: (type, replaceWith) =>