From f663ed3359d89448e03022d4caa6de662f0ab077 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 13 Oct 2017 23:13:06 -0400 Subject: [PATCH] fix assets not being reloaded when mods implement IAssetEditor or IAssetLoader directly --- src/SMAPI/Program.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/SMAPI/Program.cs b/src/SMAPI/Program.cs index 293c9da7..fe306e24 100644 --- a/src/SMAPI/Program.cs +++ b/src/SMAPI/Program.cs @@ -774,6 +774,13 @@ namespace StardewModdingAPI // add interceptors if (metadata.Mod.Helper.Content is ContentHelper helper) { + // ReSharper disable SuspiciousTypeConversion.Global + if (metadata.Mod is IAssetEditor editor) + helper.ObservableAssetEditors.Add(editor); + if (metadata.Mod is IAssetLoader loader) + helper.ObservableAssetLoaders.Add(loader); + // ReSharper restore SuspiciousTypeConversion.Global + this.ContentManager.Editors[metadata] = helper.ObservableAssetEditors; this.ContentManager.Loaders[metadata] = helper.ObservableAssetLoaders; }