summaryrefslogtreecommitdiff
path: root/src/SMAPI.Mods.ConsoleCommands/Framework/Commands
diff options
context:
space:
mode:
authorbladeoflight16 <1159076+bladeoflight16@users.noreply.github.com>2021-07-26 21:32:29 -0400
committerbladeoflight16 <1159076+bladeoflight16@users.noreply.github.com>2021-07-27 17:23:54 -0400
commit428f0c5880fa8b133f601beda2e27c87dc7134af (patch)
tree263cebcfb3acb230f5e1356bc8101f10cbf89467 /src/SMAPI.Mods.ConsoleCommands/Framework/Commands
parentec7af3e2eede702425a50458aa0536e5da849247 (diff)
downloadSMAPI-428f0c5880fa8b133f601beda2e27c87dc7134af.tar.gz
SMAPI-428f0c5880fa8b133f601beda2e27c87dc7134af.tar.bz2
SMAPI-428f0c5880fa8b133f601beda2e27c87dc7134af.zip
world_clear: Adding 'removeable' option that includes everything except permanent bushes
Diffstat (limited to 'src/SMAPI.Mods.ConsoleCommands/Framework/Commands')
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/ClearCommand.cs16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/ClearCommand.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/ClearCommand.cs
index 2f34d381..d7cd40ec 100644
--- a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/ClearCommand.cs
+++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/ClearCommand.cs
@@ -15,7 +15,7 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.World
** Fields
*********/
/// <summary>The valid types that can be cleared.</summary>
- private readonly string[] ValidTypes = { "crops", "debris", "fruit-trees", "furniture", "grass", "trees", "everything" };
+ private readonly string[] ValidTypes = { "crops", "debris", "fruit-trees", "furniture", "grass", "trees", "removeable", "everything" };
/// <summary>The resource clump IDs to consider debris.</summary>
private readonly int[] DebrisClumps = { ResourceClump.stumpIndex, ResourceClump.hollowLogIndex, ResourceClump.meteoriteIndex, ResourceClump.boulderIndex };
@@ -30,8 +30,8 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.World
name: "world_clear",
description: "Clears in-game entities in a given location.\n\n"
+ "Usage: world_clear <location> <object type>\n"
- + " - 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)."
+ " - 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), 'furniture', 'grass', and 'trees' / 'fruit-trees'. You can also specify 'removeable', which includes everything that can be removed or destroyed during normal game play, or 'everything', which includes permanent bushes."
)
{ }
@@ -133,6 +133,18 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.World
break;
}
+ case "removeable":
+ {
+ int removed =
+ this.RemoveFurniture(location, p => true)
+ + this.RemoveObjects(location, p => true)
+ + this.RemoveTerrainFeatures(location, p => true)
+ + this.RemoveLargeTerrainFeatures(location, p => !(p is Bush) || ((Bush)p).isDestroyable(location, p.currentTileLocation))
+ + this.RemoveResourceClumps(location, p => true);
+ monitor.Log($"Done! Removed {removed} entities from {location.Name}.", LogLevel.Info);
+ break;
+ }
+
case "everything":
{
int removed =