summaryrefslogtreecommitdiff
path: root/src/SMAPI
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-11-10 23:27:38 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-11-10 23:27:38 -0500
commit346fddda670704c1458e42104ee7405fc1de7ccc (patch)
treef84d2f8915b1c9ccb90a5dbf0de48a9f85c4b18b /src/SMAPI
parent55eec58eafb9ba07f3e8b0a1c8394cb114de17a0 (diff)
downloadSMAPI-346fddda670704c1458e42104ee7405fc1de7ccc.tar.gz
SMAPI-346fddda670704c1458e42104ee7405fc1de7ccc.tar.bz2
SMAPI-346fddda670704c1458e42104ee7405fc1de7ccc.zip
move validation logic out of Manifest model
This avoids tightly coupling higher logic to the implementation class, since we can validate the interface.
Diffstat (limited to 'src/SMAPI')
-rw-r--r--src/SMAPI/Framework/ModLoading/ModResolver.cs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/SMAPI/Framework/ModLoading/ModResolver.cs b/src/SMAPI/Framework/ModLoading/ModResolver.cs
index 352c22cc..0b4fe3e9 100644
--- a/src/SMAPI/Framework/ModLoading/ModResolver.cs
+++ b/src/SMAPI/Framework/ModLoading/ModResolver.cs
@@ -4,6 +4,7 @@ using System.Diagnostics.CodeAnalysis;
using System.IO;
using System.Linq;
using StardewModdingAPI.Toolkit;
+using StardewModdingAPI.Toolkit.Framework;
using StardewModdingAPI.Toolkit.Framework.ModData;
using StardewModdingAPI.Toolkit.Framework.ModScanning;
using StardewModdingAPI.Toolkit.Framework.UpdateData;
@@ -138,7 +139,7 @@ namespace StardewModdingAPI.Framework.ModLoading
}
// validate manifest
- if (mod.Manifest is Manifest manifest && !manifest.TryValidate(out string manifestError))
+ if (!ManifestValidator.TryValidate(mod.Manifest, out string manifestError))
{
mod.SetStatus(ModMetadataStatus.Failed, ModFailReason.InvalidManifest, $"its {manifestError}");
continue;