From 1870336f4c175b067690fdd6c390ae74bed984b7 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 20 Dec 2020 22:35:01 -0500 Subject: update for item changes --- src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs | 7 +------ 1 file changed, 1 insertion(+), 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 d1dd758b..34149209 100644 --- a/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs +++ b/src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs @@ -107,12 +107,7 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework // furniture foreach (int id in this.TryLoad("Data\\Furniture").Keys) - { - if (id == 1466 || id == 1468 || id == 1680) - yield return this.TryCreate(ItemType.Furniture, id, p => new TV(p.ID, Vector2.Zero)); - else - yield return this.TryCreate(ItemType.Furniture, id, p => new Furniture(p.ID, Vector2.Zero)); - } + yield return this.TryCreate(ItemType.Furniture, id, p => Furniture.GetFurnitureInstance(p.ID)); // craftables foreach (int id in Game1.bigCraftablesInformation.Keys) -- cgit From fb244dc936b8929dc032ad326f8cad0c9fc80d92 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 20 Dec 2020 22:35:01 -0500 Subject: update for location furniture changes --- docs/release-notes.md | 3 +++ .../Framework/Commands/World/ClearCommand.cs | 22 +++++++++++++--------- 2 files changed, 16 insertions(+), 9 deletions(-) (limited to 'src/SMAPI.Mods.ConsoleCommands') diff --git a/docs/release-notes.md b/docs/release-notes.md index 176961d4..2c3720e8 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -15,6 +15,9 @@ * Added `PerScreen` utility and new `Context` fields to simplify split-screen support in mods. * Added screen ID to log when playing in split-screen mode. +* For the Console Commands mod: + * Added `furniture` option to `world_clear`. + ## 3.7.6 Released 21 November 2020 for Stardew Valley 1.4.1 or later. diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/ClearCommand.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/ClearCommand.cs index 1190a4ab..29052be3 100644 --- a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/ClearCommand.cs +++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/ClearCommand.cs @@ -16,7 +16,7 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.World ** Fields *********/ /// The valid types that can be cleared. - private readonly string[] ValidTypes = { "crops", "debris", "fruit-trees", "grass", "trees", "everything" }; + private readonly string[] ValidTypes = { "crops", "debris", "fruit-trees", "furniture", "grass", "trees", "everything" }; /// The resource clump IDs to consider debris. private readonly int[] DebrisClumps = { ResourceClump.stumpIndex, ResourceClump.hollowLogIndex, ResourceClump.meteoriteIndex, ResourceClump.boulderIndex }; @@ -32,7 +32,7 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.World description: "Clears in-game entities in a given location.\n\n" + "Usage: world_clear \n" + "- location: the location name for which to clear objects (like Farm), or 'current' for the current location.\n" - + " - object type: the type of object clear. You can specify 'crops', 'debris' (stones/twigs/weeds and dead crops), 'grass', and 'trees' / 'fruit-trees'. You can also specify 'everything', which includes things not removed by the other types (like furniture or resource clumps)." + + " - object type: the type of object clear. You can specify 'crops', 'debris' (stones/twigs/weeds and dead crops), 'furniture', 'grass', and 'trees' / 'fruit-trees'. You can also specify 'everything', which includes things not removed by the other types (like resource clumps)." ) { } @@ -113,6 +113,13 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.World break; } + case "furniture": + { + int removed = this.RemoveFurniture(location, furniture => true); + monitor.Log($"Done! Removed {removed} entities from {location.Name}.", LogLevel.Info); + break; + } + case "grass": { int removed = this.RemoveTerrainFeatures(location, feature => feature is Grass); @@ -244,15 +251,12 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.World { int removed = 0; - if (location is DecoratableLocation decoratableLocation) + foreach (Furniture furniture in location.furniture.ToArray()) { - foreach (Furniture furniture in decoratableLocation.furniture.ToArray()) + if (shouldRemove(furniture)) { - if (shouldRemove(furniture)) - { - decoratableLocation.furniture.Remove(furniture); - removed++; - } + location.furniture.Remove(furniture); + removed++; } } -- cgit From 872a1d5627f20faece618644db1ae4749e124741 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 21 Dec 2020 12:24:43 -0500 Subject: prepare for release --- build/common.targets | 2 +- docs/release-notes.md | 11 ++++++++--- src/SMAPI.Mods.ConsoleCommands/manifest.json | 4 ++-- src/SMAPI.Mods.SaveBackup/manifest.json | 4 ++-- src/SMAPI/Constants.cs | 2 +- 5 files changed, 14 insertions(+), 9 deletions(-) (limited to 'src/SMAPI.Mods.ConsoleCommands') diff --git a/build/common.targets b/build/common.targets index d8b29488..ee4f918f 100644 --- a/build/common.targets +++ b/build/common.targets @@ -4,7 +4,7 @@ - 3.7.6 + 3.8.0 SMAPI latest diff --git a/docs/release-notes.md b/docs/release-notes.md index b02b58d1..d550857c 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -7,11 +7,13 @@ * 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.8 +Released 21 December 2020 for Stardew Valley 1.5 or later. + * For players: * Updated for Stardew Valley 1.5, including split-screen support. - * When the installer is run from within a game folder, it now installs SMAPI to that folder. That simplifies installation if you have multiple copies of the game or it can't otherwise auto-detect the game path. - * Clarified not-a-mod error when the SMAPI installer is in the `Mods` folder. + * You can now run the installer from a subfolder of your game folder to auto-detect it. That simplifies installation if you have multiple copies of the game or it can't otherwise auto-detect the game path. + * Clarified error when the SMAPI installer is in the `Mods` folder. * For modders: * Added `PerScreen` utility and new `Context` fields to simplify split-screen support in mods. @@ -20,6 +22,9 @@ * For the Console Commands mod: * Added `furniture` option to `world_clear`. +* For the web UI: + * Updated the JSON validator/schema for Content Patcher 1.19. + ## 3.7.6 Released 21 November 2020 for Stardew Valley 1.4.1 or later. diff --git a/src/SMAPI.Mods.ConsoleCommands/manifest.json b/src/SMAPI.Mods.ConsoleCommands/manifest.json index ddc55a73..a1a137a1 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.7.6", + "Version": "3.8.0", "Description": "Adds SMAPI console commands that let you manipulate the game.", "UniqueID": "SMAPI.ConsoleCommands", "EntryDll": "ConsoleCommands.dll", - "MinimumApiVersion": "3.7.6" + "MinimumApiVersion": "3.8.0" } diff --git a/src/SMAPI.Mods.SaveBackup/manifest.json b/src/SMAPI.Mods.SaveBackup/manifest.json index 0fe98909..96822f4a 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.7.6", + "Version": "3.8.0", "Description": "Automatically backs up all your saves once per day into its folder.", "UniqueID": "SMAPI.SaveBackup", "EntryDll": "SaveBackup.dll", - "MinimumApiVersion": "3.7.6" + "MinimumApiVersion": "3.8.0" } diff --git a/src/SMAPI/Constants.cs b/src/SMAPI/Constants.cs index 5aa08887..98d0277b 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.7.6"); + public static ISemanticVersion ApiVersion { get; } = new Toolkit.SemanticVersion("3.8.0"); /// The minimum supported version of Stardew Valley. public static ISemanticVersion MinimumGameVersion { get; } = new GameVersion("1.5.0"); -- cgit