fix world_clear removing chests that match a debris name

This commit is contained in:
Jesse Plamondon-Willard 2019-03-17 19:22:03 -04:00
parent 4a7fb8bad2
commit 552886a0f3
No known key found for this signature in database
GPG Key ID: 7D7C8097B62033CE
2 changed files with 9 additions and 1 deletions

View File

@ -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.

View File

@ -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);