From 6cd6eb43a123cef2aab811e23aea97dadc95e5ee Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Fri, 22 Jan 2021 23:08:26 -0500 Subject: [PATCH 1/6] link to 3.9 release highlights --- docs/release-notes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index 0f83e044..d6c8d368 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -8,7 +8,7 @@ --> ## 3.9 -Released 22 January 2021 for Stardew Valley 1.5.4 or later. +Released 22 January 2021 for Stardew Valley 1.5.4 or later. See [release highlights](https://www.patreon.com/posts/46553874). * For players: * Updated for Stardew Valley 1.5.4. From 66017a39d9091520bad81253be21daa8c7fd2c36 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 23 Jan 2021 11:59:36 -0500 Subject: [PATCH 2/6] disable 'patched game code' warning for ErrorHandler It doesn't really make sense for SMAPI to show a warning about itself. --- docs/release-notes.md | 4 ++++ src/SMAPI.Web/wwwroot/SMAPI.metadata.json | 19 ++++++++++++++++--- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index d6c8d368..6407ff2d 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -7,6 +7,10 @@ * Migrated to Harmony 2.0 (see [_migrate to Harmony 2.0_](https://stardewvalleywiki.com/Modding:Migrate_to_Harmony_2.0) for more info). --> +## Upcoming release +* For the Error Handler mod: + * Disabled 'patched game code' warning. + ## 3.9 Released 22 January 2021 for Stardew Valley 1.5.4 or later. See [release highlights](https://www.patreon.com/posts/46553874). diff --git a/src/SMAPI.Web/wwwroot/SMAPI.metadata.json b/src/SMAPI.Web/wwwroot/SMAPI.metadata.json index e75a6bc0..150aec65 100644 --- a/src/SMAPI.Web/wwwroot/SMAPI.metadata.json +++ b/src/SMAPI.Web/wwwroot/SMAPI.metadata.json @@ -3,6 +3,7 @@ * Metadata about some SMAPI mods used in compatibility, update, and dependency checks. This * field shouldn't be edited by players in most cases. * + * * Standard fields * =============== * The predefined fields are documented below (only 'ID' is required). Each entry's key is the @@ -14,6 +15,10 @@ * other fields if no ID was specified. This doesn't include the latest ID, if any. Multiple * variants can be separated with '|'. * + * - SuppressWarnings: the mod warnings to suppress, even if they'd normally be shown. This + * should match the ModWarning enum. + * + * * Versioned metadata * ================== * Each record can also specify extra metadata using the field keys below. @@ -49,6 +54,14 @@ * mod is no longer compatible. */ "ModData": { + /********* + ** Mods bundles with SMAPI + *********/ + "Error Handler": { + "ID": "SMAPI.ErrorHandler", + "SuppressWarnings": "PatchesGame" + }, + /********* ** Common dependencies for friendly errors *********/ @@ -186,7 +199,7 @@ "~0.11.2 | Status": "AssumeBroken", "~0.11.2 | StatusReasonDetails": "causes errors and custom furniture no longer work in Stardew Valley 1.5" }, - + "Custom Localization": { "ID": "ZaneYork.CustomLocalization", "FormerIDs": "SMAPI.CustomLocalization", // changed in 1.0.1 @@ -427,13 +440,13 @@ "Fishing Adjust": { "ID": "shuaiz.FishingAdjustMod", "~2.0.1 | Status": "AssumeBroken", - "~2.0.1 | StatusReasonDetails": "fails with 'method not found' error for 'Void Harmony.HarmonyInstance.Patch(System.Reflection.MethodBase, Harmony.HarmonyMethod, Harmony.HarmonyMethod, Harmony.HarmonyMethod)'" + "~2.0.1 | StatusReasonDetails": "fails with 'method not found' error for 'Void Harmony.HarmonyInstance.Patch(System.Reflection.MethodBase, Harmony.HarmonyMethod, Harmony.HarmonyMethod, Harmony.HarmonyMethod)'" }, "Fishing Automaton": { "ID": "Drynwynn.FishingAutomaton", "~1.1 | Status": "AssumeBroken", - "~1.1 | StatusReasonDetails": "runtime errors with Harmony 1.2.0.1 in SMAPI 2.8+" + "~1.1 | StatusReasonDetails": "runtime errors with Harmony 1.2.0.1 in SMAPI 2.8+" }, "More Silo Storage": { From 4c0272c0aaec58fbd457e87650f66a067efc2fee Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 23 Jan 2021 12:01:46 -0500 Subject: [PATCH 3/6] remove unused AlternativeUrl field in metadata model --- src/SMAPI.Tests/Core/ModResolverTests.cs | 3 +-- src/SMAPI.Toolkit/Framework/ModData/ModDataField.cs | 1 - src/SMAPI.Toolkit/Framework/ModData/ModDataFieldKey.cs | 3 --- src/SMAPI.Toolkit/Framework/ModData/ModDataRecord.cs | 5 ----- .../Framework/ModData/ModDataRecordVersionedFields.cs | 3 --- src/SMAPI.Web/wwwroot/SMAPI.metadata.json | 3 --- src/SMAPI/Framework/ModLoading/ModResolver.cs | 2 -- 7 files changed, 1 insertion(+), 19 deletions(-) diff --git a/src/SMAPI.Tests/Core/ModResolverTests.cs b/src/SMAPI.Tests/Core/ModResolverTests.cs index 78056ef7..28262111 100644 --- a/src/SMAPI.Tests/Core/ModResolverTests.cs +++ b/src/SMAPI.Tests/Core/ModResolverTests.cs @@ -146,8 +146,7 @@ namespace SMAPI.Tests.Core Mock mock = this.GetMetadata("Mod A", new string[0], allowStatusChange: true); this.SetupMetadataForValidation(mock, new ModDataRecordVersionedFields { - Status = ModStatus.AssumeBroken, - AlternativeUrl = "https://example.org" + Status = ModStatus.AssumeBroken }); // act diff --git a/src/SMAPI.Toolkit/Framework/ModData/ModDataField.cs b/src/SMAPI.Toolkit/Framework/ModData/ModDataField.cs index 44422f01..6658d219 100644 --- a/src/SMAPI.Toolkit/Framework/ModData/ModDataField.cs +++ b/src/SMAPI.Toolkit/Framework/ModData/ModDataField.cs @@ -69,7 +69,6 @@ namespace StardewModdingAPI.Toolkit.Framework.ModData return manifest.UpdateKeys != null && manifest.UpdateKeys.Any(p => !string.IsNullOrWhiteSpace(p)); // non-manifest fields - case ModDataFieldKey.AlternativeUrl: case ModDataFieldKey.StatusReasonPhrase: case ModDataFieldKey.StatusReasonDetails: case ModDataFieldKey.Status: diff --git a/src/SMAPI.Toolkit/Framework/ModData/ModDataFieldKey.cs b/src/SMAPI.Toolkit/Framework/ModData/ModDataFieldKey.cs index 068291aa..2b59096d 100644 --- a/src/SMAPI.Toolkit/Framework/ModData/ModDataFieldKey.cs +++ b/src/SMAPI.Toolkit/Framework/ModData/ModDataFieldKey.cs @@ -6,9 +6,6 @@ namespace StardewModdingAPI.Toolkit.Framework.ModData /// A manifest update key. UpdateKey, - /// An alternative URL the player can check for an updated version. - AlternativeUrl, - /// The mod's predefined compatibility status. Status, diff --git a/src/SMAPI.Toolkit/Framework/ModData/ModDataRecord.cs b/src/SMAPI.Toolkit/Framework/ModData/ModDataRecord.cs index f28f6afe..5dd32acf 100644 --- a/src/SMAPI.Toolkit/Framework/ModData/ModDataRecord.cs +++ b/src/SMAPI.Toolkit/Framework/ModData/ModDataRecord.cs @@ -92,11 +92,6 @@ namespace StardewModdingAPI.Toolkit.Framework.ModData parsed.UpdateKey = field.Value; break; - // alternative URL - case ModDataFieldKey.AlternativeUrl: - parsed.AlternativeUrl = field.Value; - break; - // status case ModDataFieldKey.Status: parsed.Status = (ModStatus)Enum.Parse(typeof(ModStatus), field.Value, ignoreCase: true); diff --git a/src/SMAPI.Toolkit/Framework/ModData/ModDataRecordVersionedFields.cs b/src/SMAPI.Toolkit/Framework/ModData/ModDataRecordVersionedFields.cs index f0282eb4..5aaabd51 100644 --- a/src/SMAPI.Toolkit/Framework/ModData/ModDataRecordVersionedFields.cs +++ b/src/SMAPI.Toolkit/Framework/ModData/ModDataRecordVersionedFields.cs @@ -15,9 +15,6 @@ namespace StardewModdingAPI.Toolkit.Framework.ModData /// The update key to apply. public string UpdateKey { get; set; } - /// The alternative URL the player can check for an updated version. - public string AlternativeUrl { get; set; } - /// The predefined compatibility status. public ModStatus Status { get; set; } = ModStatus.None; diff --git a/src/SMAPI.Web/wwwroot/SMAPI.metadata.json b/src/SMAPI.Web/wwwroot/SMAPI.metadata.json index 150aec65..8cc60a73 100644 --- a/src/SMAPI.Web/wwwroot/SMAPI.metadata.json +++ b/src/SMAPI.Web/wwwroot/SMAPI.metadata.json @@ -49,9 +49,6 @@ * * - StatusReasonDetails: a technical reason shown in TRACE logs, indicating why the status * was overridden. If not provided, it defaults to the StatusReasonPhrase or 'no reason given'. - * - * - AlternativeUrl: a URL where the player can find an unofficial update or alternative if the - * mod is no longer compatible. */ "ModData": { /********* diff --git a/src/SMAPI/Framework/ModLoading/ModResolver.cs b/src/SMAPI/Framework/ModLoading/ModResolver.cs index af7d90f6..c70820e4 100644 --- a/src/SMAPI/Framework/ModLoading/ModResolver.cs +++ b/src/SMAPI/Framework/ModLoading/ModResolver.cs @@ -88,8 +88,6 @@ namespace StardewModdingAPI.Framework.ModLoading if (url != null) updateUrls.Add(url); } - if (mod.DataRecord.AlternativeUrl != null) - updateUrls.Add(mod.DataRecord.AlternativeUrl); // default update URL updateUrls.Add("https://smapi.io/mods"); From 5129c361c94bd2f4e2e9ef8d39235dc6159a849d Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 24 Jan 2021 00:32:26 -0500 Subject: [PATCH 4/6] fix interior door errors when reloading maps --- docs/release-notes.md | 5 +++-- src/SMAPI/Metadata/CoreAssetPropagator.cs | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index 6407ff2d..1e7558ff 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -8,8 +8,9 @@ --> ## Upcoming release -* For the Error Handler mod: - * Disabled 'patched game code' warning. +* For players: + * Fixed _tile contains an invalid TileSheet reference_ errors when mods change certain maps. + * Fixed _patched game code_ issue shown for the bundled ErrorHandler mod. ## 3.9 Released 22 January 2021 for Stardew Valley 1.5.4 or later. See [release highlights](https://www.patreon.com/posts/46553874). diff --git a/src/SMAPI/Metadata/CoreAssetPropagator.cs b/src/SMAPI/Metadata/CoreAssetPropagator.cs index 4b911a83..f486321e 100644 --- a/src/SMAPI/Metadata/CoreAssetPropagator.cs +++ b/src/SMAPI/Metadata/CoreAssetPropagator.cs @@ -785,6 +785,7 @@ namespace StardewModdingAPI.Metadata private void ReloadMap(GameLocation location) { // reload map + location.interiorDoors.Clear(); // prevent errors when doors try to update tiles which no longer exist location.reloadMap(); location.updateWarps(); location.MakeMapModifications(force: true); From 0058267c36dbc11326a7a1839540809421ea82da Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 24 Jan 2021 01:05:40 -0500 Subject: [PATCH 5/6] minor cleanup --- src/SMAPI/Framework/ContentCoordinator.cs | 24 +++++++++++++++++++++-- src/SMAPI/Metadata/CoreAssetPropagator.cs | 7 ++++--- 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/src/SMAPI/Framework/ContentCoordinator.cs b/src/SMAPI/Framework/ContentCoordinator.cs index 27fb3dbb..77dd6c72 100644 --- a/src/SMAPI/Framework/ContentCoordinator.cs +++ b/src/SMAPI/Framework/ContentCoordinator.cs @@ -99,7 +99,17 @@ namespace StardewModdingAPI.Framework this.OnLoadingFirstAsset = onLoadingFirstAsset; this.FullRootDirectory = Path.Combine(Constants.ExecutionPath, rootDirectory); this.ContentManagers.Add( - this.MainContentManager = new GameContentManager("Game1.content", serviceProvider, rootDirectory, currentCulture, this, monitor, reflection, this.OnDisposing, onLoadingFirstAsset) + this.MainContentManager = new GameContentManager( + name: "Game1.content", + serviceProvider: serviceProvider, + rootDirectory: rootDirectory, + currentCulture: currentCulture, + coordinator: this, + monitor: monitor, + reflection: reflection, + onDisposing: this.OnDisposing, + onLoadingFirstAsset: onLoadingFirstAsset + ) ); this.VanillaContentManager = new LocalizedContentManager(serviceProvider, rootDirectory); this.CoreAssets = new CoreAssetPropagator(this.MainContentManager.AssertAndNormalizeAssetName, reflection); @@ -111,7 +121,17 @@ namespace StardewModdingAPI.Framework { return this.ContentManagerLock.InWriteLock(() => { - GameContentManager manager = new GameContentManager(name, this.MainContentManager.ServiceProvider, this.MainContentManager.RootDirectory, this.MainContentManager.CurrentCulture, this, this.Monitor, this.Reflection, this.OnDisposing, this.OnLoadingFirstAsset); + GameContentManager manager = new GameContentManager( + name: name, + serviceProvider: this.MainContentManager.ServiceProvider, + rootDirectory: this.MainContentManager.RootDirectory, + currentCulture: this.MainContentManager.CurrentCulture, + coordinator: this, + monitor: this.Monitor, + reflection: this.Reflection, + onDisposing: this.OnDisposing, + onLoadingFirstAsset: this.OnLoadingFirstAsset + ); this.ContentManagers.Add(manager); return manager; }); diff --git a/src/SMAPI/Metadata/CoreAssetPropagator.cs b/src/SMAPI/Metadata/CoreAssetPropagator.cs index f486321e..063804e0 100644 --- a/src/SMAPI/Metadata/CoreAssetPropagator.cs +++ b/src/SMAPI/Metadata/CoreAssetPropagator.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; using System.IO; using System.Linq; using Microsoft.Xna.Framework.Graphics; @@ -79,7 +80,7 @@ namespace StardewModdingAPI.Metadata }); // reload assets - IDictionary propagated = assets.ToDictionary(p => p.Key, p => false, StringComparer.OrdinalIgnoreCase); + IDictionary propagated = assets.ToDictionary(p => p.Key, _ => false, StringComparer.OrdinalIgnoreCase); foreach (var bucket in buckets) { switch (bucket.Key) @@ -110,6 +111,7 @@ namespace StardewModdingAPI.Metadata /// The asset key to reload. /// The asset type to reload. /// Returns whether an asset was loaded. The return value may be true or false, or a non-null value for true. + [SuppressMessage("ReSharper", "StringLiteralTypo", Justification = "These deliberately match the asset names.")] private bool PropagateOther(LocalizedContentManager content, string key, Type type) { key = this.AssertAndNormalizeAssetName(key); @@ -492,8 +494,7 @@ namespace StardewModdingAPI.Metadata return true; case "terrainfeatures\\grass": // from Grass - this.ReloadGrassTextures(content, key); - return true; + return this.ReloadGrassTextures(content, key); case "terrainfeatures\\hoedirt": // from HoeDirt HoeDirt.lightTexture = content.Load(key); From 082028016993606e8deec84027c781d77e062caa Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 25 Jan 2021 21:52:51 -0500 Subject: [PATCH 6/6] prepare for release --- build/common.targets | 2 +- docs/release-notes.md | 8 +++++--- src/SMAPI.Mods.ConsoleCommands/manifest.json | 4 ++-- src/SMAPI.Mods.ErrorHandler/manifest.json | 4 ++-- src/SMAPI.Mods.SaveBackup/manifest.json | 4 ++-- src/SMAPI/Constants.cs | 2 +- 6 files changed, 13 insertions(+), 11 deletions(-) diff --git a/build/common.targets b/build/common.targets index 30c059a3..a38f15a6 100644 --- a/build/common.targets +++ b/build/common.targets @@ -4,7 +4,7 @@ - 3.9.0 + 3.9.1 SMAPI latest diff --git a/docs/release-notes.md b/docs/release-notes.md index 1e7558ff..dabdada1 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -7,10 +7,12 @@ * Migrated to Harmony 2.0 (see [_migrate to Harmony 2.0_](https://stardewvalleywiki.com/Modding:Migrate_to_Harmony_2.0) for more info). --> -## Upcoming release +## 3.9.1 +Released 25 January 2021 for Stardew Valley 1.5.4 or later. + * For players: - * Fixed _tile contains an invalid TileSheet reference_ errors when mods change certain maps. - * Fixed _patched game code_ issue shown for the bundled ErrorHandler mod. + * Fixed _tile contains an invalid TileSheet reference_ crash after mods change certain maps. + * Fixed _patched game code_ issue shown for the bundled Error Handler mod. ## 3.9 Released 22 January 2021 for Stardew Valley 1.5.4 or later. See [release highlights](https://www.patreon.com/posts/46553874). diff --git a/src/SMAPI.Mods.ConsoleCommands/manifest.json b/src/SMAPI.Mods.ConsoleCommands/manifest.json index f2340638..10611e08 100644 --- a/src/SMAPI.Mods.ConsoleCommands/manifest.json +++ b/src/SMAPI.Mods.ConsoleCommands/manifest.json @@ -1,9 +1,9 @@ { "Name": "Console Commands", "Author": "SMAPI", - "Version": "3.9.0", + "Version": "3.9.1", "Description": "Adds SMAPI console commands that let you manipulate the game.", "UniqueID": "SMAPI.ConsoleCommands", "EntryDll": "ConsoleCommands.dll", - "MinimumApiVersion": "3.9.0" + "MinimumApiVersion": "3.9.1" } diff --git a/src/SMAPI.Mods.ErrorHandler/manifest.json b/src/SMAPI.Mods.ErrorHandler/manifest.json index bc0a7294..bb9942d1 100644 --- a/src/SMAPI.Mods.ErrorHandler/manifest.json +++ b/src/SMAPI.Mods.ErrorHandler/manifest.json @@ -1,9 +1,9 @@ { "Name": "Error Handler", "Author": "SMAPI", - "Version": "3.9.0", + "Version": "3.9.1", "Description": "Handles some common vanilla errors to log more useful info or avoid breaking the game.", "UniqueID": "SMAPI.ErrorHandler", "EntryDll": "ErrorHandler.dll", - "MinimumApiVersion": "3.9.0" + "MinimumApiVersion": "3.9.1" } diff --git a/src/SMAPI.Mods.SaveBackup/manifest.json b/src/SMAPI.Mods.SaveBackup/manifest.json index 79727fad..95ee5144 100644 --- a/src/SMAPI.Mods.SaveBackup/manifest.json +++ b/src/SMAPI.Mods.SaveBackup/manifest.json @@ -1,9 +1,9 @@ { "Name": "Save Backup", "Author": "SMAPI", - "Version": "3.9.0", + "Version": "3.9.1", "Description": "Automatically backs up all your saves once per day into its folder.", "UniqueID": "SMAPI.SaveBackup", "EntryDll": "SaveBackup.dll", - "MinimumApiVersion": "3.9.0" + "MinimumApiVersion": "3.9.1" } diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index 2adafbbf..57c40bbf 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -54,7 +54,7 @@ namespace StardewModdingAPI ** Public ****/ /// SMAPI's current semantic version. - public static ISemanticVersion ApiVersion { get; } = new Toolkit.SemanticVersion("3.9.0"); + public static ISemanticVersion ApiVersion { get; } = new Toolkit.SemanticVersion("3.9.1"); /// The minimum supported version of Stardew Valley. public static ISemanticVersion MinimumGameVersion { get; } = new GameVersion("1.5.4");