Skip to content

Commit 74bb0e8

Browse files
committed
add smoked and dried items to item repository
1 parent 74ed1cb commit 74bb0e8

2 files changed

Lines changed: 29 additions & 4 deletions

File tree

docs/release-notes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* For players:
66
* Fixed installer not detecting Linux Flatpak install paths.
77
* Fixed content issues for non-English players in recent builds (e.g. content packs not detecting the current festival correctly).
8-
* Fixed pickled forage not shown by `list_items` console command.
8+
* Fixed dried items, smoked items, and picked forage not handled by console commands like `list_items` or `player_add`.
99

1010
* For mod authors:
1111
* Updated dependencies, including...

src/SMAPI.Mods.ConsoleCommands/Framework/ItemRepository.cs

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,24 @@ public IEnumerable<SearchableItem> GetAll(string? onlyType = null, bool includeV
7474
// object
7575
else
7676
{
77-
yield return result?.QualifiedItemId == "(O)340"
78-
? this.TryCreate(itemType.Identifier, result.Id, _ => objectDataDefinition.CreateFlavoredHoney(null)) // game creates "Wild Honey" when there's no ingredient, instead of the base Honey item
79-
: result;
77+
switch (result?.QualifiedItemId)
78+
{
79+
// honey should be "Wild Honey" when there's no ingredient, instead of the base Honey item
80+
case "(O)340":
81+
yield return this.TryCreate(itemType.Identifier, result.Id, _ => objectDataDefinition.CreateFlavoredHoney(null));
82+
break;
83+
84+
// don't return placeholder items
85+
case "(O)DriedFruit":
86+
case "(O)DriedMushrooms":
87+
case "(O)SmokedFish":
88+
break;
89+
90+
default:
91+
if (result != null)
92+
yield return result;
93+
break;
94+
}
8095

8196
if (includeVariants)
8297
{
@@ -172,10 +187,17 @@ select item
172187
// by category
173188
switch (item.Category)
174189
{
190+
// fish
191+
case SObject.FishCategory:
192+
yield return this.TryCreate(itemType.Identifier, $"SmokedFish/{id}", _ => objectDataDefinition.CreateFlavoredSmokedFish(item));
193+
break;
194+
175195
// fruit products
176196
case SObject.FruitsCategory:
177197
yield return this.TryCreate(itemType.Identifier, $"348/{id}", _ => objectDataDefinition.CreateFlavoredWine(item));
178198
yield return this.TryCreate(itemType.Identifier, $"344/{id}", _ => objectDataDefinition.CreateFlavoredJelly(item));
199+
if (item.QualifiedItemId != "(O)398") // raisins are their own item
200+
yield return this.TryCreate(itemType.Identifier, $"398/{id}", _ => objectDataDefinition.CreateFlavoredDriedFruit(item));
179201
break;
180202

181203
// greens
@@ -229,6 +251,9 @@ select item
229251
// by context tag
230252
if (item.HasContextTag("preserves_pickle") && item.Category is not (SObject.GreensCategory or SObject.VegetableCategory))
231253
yield return this.TryCreate(itemType.Identifier, $"342/{id}", _ => objectDataDefinition.CreateFlavoredPickle(item));
254+
255+
if (item.HasContextTag("edible_mushroom"))
256+
yield return this.TryCreate(itemType.Identifier, $"DriedMushrooms/{id}", _ => objectDataDefinition.CreateFlavoredDriedMushroom(item));
232257
}
233258

234259
/// <summary>Get optimized lookups to match items which produce roe in a fish pond.</summary>

0 commit comments

Comments
 (0)