From 86607423916785ae7d0933436d8a755581f35b2b Mon Sep 17 00:00:00 2001 From: DaLion Date: Wed, 7 Dec 2022 18:13:17 -0300 Subject: Replaced slingshot ID check with Type check. --- src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/SMAPI.Mods.ConsoleCommands') diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs index 88ddfe6b..99de01b9 100644 --- a/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs +++ b/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs @@ -104,9 +104,10 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework // weapons if (ShouldGet(ItemType.Weapon)) { - foreach (int id in this.TryLoad("Data\\weapons").Keys) + var weaponsData = this.TryLoad("Data\\weapons"); + foreach (int id in weaponsData.Keys) { - yield return this.TryCreate(ItemType.Weapon, id, p => p.ID is >= 32 and <= 34 + yield return this.TryCreate(ItemType.Weapon, id, p => weaponsData[p.ID].Split('/')[8] == "4" ? new Slingshot(p.ID) : new MeleeWeapon(p.ID) ); -- cgit From 45979c57dd350fc5c08155fd0794cf3c3519a256 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 28 Dec 2022 11:30:35 -0500 Subject: defer weapon data parsing until needed, handle invalid formats --- .../Framework/ItemRepository.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/SMAPI.Mods.ConsoleCommands') diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs index 99de01b9..c4619577 100644 --- a/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs +++ b/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs @@ -104,13 +104,18 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework // weapons if (ShouldGet(ItemType.Weapon)) { - var weaponsData = this.TryLoad("Data\\weapons"); - foreach (int id in weaponsData.Keys) + Dictionary weaponsData = this.TryLoad("Data\\weapons"); + foreach (KeyValuePair pair in weaponsData) { - yield return this.TryCreate(ItemType.Weapon, id, p => weaponsData[p.ID].Split('/')[8] == "4" - ? new Slingshot(p.ID) - : new MeleeWeapon(p.ID) - ); + string rawFields = pair.Value; + yield return this.TryCreate(ItemType.Weapon, pair.Key, p => + { + string[] fields = rawFields.Split('/'); + bool isSlingshot = fields.Length > 8 && fields[8] == "4"; + return isSlingshot + ? new Slingshot(p.ID) + : new MeleeWeapon(p.ID); + }); } } -- cgit From 25b8e13ba827a0512f5089d3bd22e8ed1a15e7ba Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 9 Jan 2023 12:27:29 -0500 Subject: prepare for release --- build/common.targets | 2 +- docs/release-notes.md | 11 +++++++---- docs/technical/mod-package.md | 6 ++++-- src/SMAPI.ModBuildConfig/SMAPI.ModBuildConfig.csproj | 2 +- 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 +- 8 files changed, 20 insertions(+), 15 deletions(-) (limited to 'src/SMAPI.Mods.ConsoleCommands') diff --git a/build/common.targets b/build/common.targets index 512107a0..590e0415 100644 --- a/build/common.targets +++ b/build/common.targets @@ -7,7 +7,7 @@ repo. It imports the other MSBuild files as needed. - 3.18.1 + 3.18.2 SMAPI latest $(AssemblySearchPaths);{GAC} diff --git a/docs/release-notes.md b/docs/release-notes.md index d095ce7c..9eb55b36 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -7,13 +7,16 @@ _If needed, you can update to SMAPI 3.16.0 first and then install the latest version._ --> -## Upcoming release +## 3.18.2 +Released 09 January 2023 for Stardew Valley 1.5.6 or later. + * For players: - * Fixed save backups being empty in rare cases on macOS. + * Fixed empty save backups for some macOS players. + * Fixed `player_add` console command not handling custom slingshots correctly (thanks too DaLion!). * For mod authors: - * Added `DelegatingModHooks` utility for rare cases where a mod needs to override SMAPI's mod hooks in the game directly. - * Updated to Newtonsoft.Json 13.0.2 (see [changes](https://github.com/JamesNK/Newtonsoft.Json/releases/tag/13.0.2)) and Pintail 2.2.1 (see [changes](https://github.com/Nanoray-pl/Pintail/blob/master/docs/release-notes.md#222)). + * Added `DelegatingModHooks` utility for mods which need to override SMAPI's mod hooks directly. + * Updated to Newtonsoft.Json 13.0.2 (see [changes](https://github.com/JamesNK/Newtonsoft.Json/releases/tag/13.0.2)) and Pintail 2.2.2 (see [changes](https://github.com/Nanoray-pl/Pintail/blob/master/docs/release-notes.md#222)). ## 3.18.1 Released 01 December 2022 for Stardew Valley 1.5.6 or later. diff --git a/docs/technical/mod-package.md b/docs/technical/mod-package.md index 0e710e50..23f0b221 100644 --- a/docs/technical/mod-package.md +++ b/docs/technical/mod-package.md @@ -412,9 +412,11 @@ The NuGet package is generated automatically in `StardewModdingAPI.ModBuildConfi when you compile it. ## Release notes -## Upcoming release +### 4.1.0 +Released 08 January 2023. + * Added `manifest.json` format validation on build (thanks to tylergibbs2!). -* Fixed game assemblies no longer excluded from the release zip if referenced explicitly without setting `BundleExtraAssemblies`. +* Fixed game DLLs not excluded from the release zip when they're referenced explicitly but `BundleExtraAssemblies` isn't set. ### 4.0.2 Released 09 October 2022. diff --git a/src/SMAPI.ModBuildConfig/SMAPI.ModBuildConfig.csproj b/src/SMAPI.ModBuildConfig/SMAPI.ModBuildConfig.csproj index efc808a1..badabfc7 100644 --- a/src/SMAPI.ModBuildConfig/SMAPI.ModBuildConfig.csproj +++ b/src/SMAPI.ModBuildConfig/SMAPI.ModBuildConfig.csproj @@ -10,7 +10,7 @@ Pathoschild.Stardew.ModBuildConfig Build package for SMAPI mods - 4.0.2 + 4.1.0 Pathoschild Automates the build configuration for crossplatform Stardew Valley SMAPI mods. For SMAPI 3.13.0 or later. MIT diff --git a/src/SMAPI.Mods.ConsoleCommands/manifest.json b/src/SMAPI.Mods.ConsoleCommands/manifest.json index 0afb5837..6ababef0 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.18.1", + "Version": "3.18.2", "Description": "Adds SMAPI console commands that let you manipulate the game.", "UniqueID": "SMAPI.ConsoleCommands", "EntryDll": "ConsoleCommands.dll", - "MinimumApiVersion": "3.18.1" + "MinimumApiVersion": "3.18.2" } diff --git a/src/SMAPI.Mods.ErrorHandler/manifest.json b/src/SMAPI.Mods.ErrorHandler/manifest.json index fe802d88..82630479 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.18.1", + "Version": "3.18.2", "Description": "Handles some common vanilla errors to log more useful info or avoid breaking the game.", "UniqueID": "SMAPI.ErrorHandler", "EntryDll": "ErrorHandler.dll", - "MinimumApiVersion": "3.18.1" + "MinimumApiVersion": "3.18.2" } diff --git a/src/SMAPI.Mods.SaveBackup/manifest.json b/src/SMAPI.Mods.SaveBackup/manifest.json index 9a587a2b..e29a3ed3 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.18.1", + "Version": "3.18.2", "Description": "Automatically backs up all your saves once per day into its folder.", "UniqueID": "SMAPI.SaveBackup", "EntryDll": "SaveBackup.dll", - "MinimumApiVersion": "3.18.1" + "MinimumApiVersion": "3.18.2" } diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index c5058e4b..482ec816 100644 --- a/src/SMAPI/Constants.cs +++ b/src/SMAPI/Constants.cs @@ -52,7 +52,7 @@ namespace StardewModdingAPI internal static int? LogScreenId { get; set; } /// SMAPI's current raw semantic version. - internal static string RawApiVersion = "3.18.1"; + internal static string RawApiVersion = "3.18.2"; } /// Contains SMAPI's constants and assumptions. -- cgit