From 552886a0f3b8d309df9ce85343f41ca7d2fc1d28 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 17 Mar 2019 19:22:03 -0400 Subject: [PATCH] fix world_clear removing chests that match a debris name --- docs/release-notes.md | 1 + .../Framework/Commands/World/ClearCommand.cs | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/release-notes.md b/docs/release-notes.md index 8f835497..228160c9 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -5,6 +5,7 @@ These changes have not been released yet. * For players: * Updated game version check for the upcoming Stardew Valley 1.4. * Updated compatibility list. + * Fixed `world_clear debris` console command removing chests edited to have a debris name. * For the web UI: * The log parser now hides some messages by default, like the mod list. diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/ClearCommand.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/ClearCommand.cs index c769b622..bd6c7952 100644 --- a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/ClearCommand.cs +++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/ClearCommand.cs @@ -83,7 +83,14 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.World } removed += - this.RemoveObjects(location, obj => obj.Name.ToLower().Contains("weed") || obj.Name == "Twig" || obj.Name == "Stone") + this.RemoveObjects(location, obj => + !(obj is Chest) + && ( + obj.Name == "Weeds" + || obj.Name == "Stone" + || (obj.ParentSheetIndex == 294 || obj.ParentSheetIndex == 295) + ) + ) + this.RemoveResourceClumps(location, clump => this.DebrisClumps.Contains(clump.parentSheetIndex.Value)); monitor.Log($"Done! Removed {removed} entities from {location.Name}.", LogLevel.Info);