From 5675f9fcebfdeb03510c347712df8e9934b362c6 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 23 May 2022 12:57:33 -0400 Subject: add watcher names to simplify troubleshooting --- src/SMAPI/Framework/StateTracking/ChestTracker.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/SMAPI/Framework/StateTracking/ChestTracker.cs') diff --git a/src/SMAPI/Framework/StateTracking/ChestTracker.cs b/src/SMAPI/Framework/StateTracking/ChestTracker.cs index c33a7498..2796ad54 100644 --- a/src/SMAPI/Framework/StateTracking/ChestTracker.cs +++ b/src/SMAPI/Framework/StateTracking/ChestTracker.cs @@ -39,11 +39,12 @@ namespace StardewModdingAPI.Framework.StateTracking ** Public methods *********/ /// Construct an instance. + /// A name which identifies what the watcher is watching, used for troubleshooting. /// The chest being tracked. - public ChestTracker(Chest chest) + public ChestTracker(string name, Chest chest) { this.Chest = chest; - this.InventoryWatcher = WatcherFactory.ForNetList(chest.items); + this.InventoryWatcher = WatcherFactory.ForNetList($"{name}.{nameof(chest.items)}", chest.items); this.StackSizes = this.Chest.items .Where(n => n != null) -- cgit