From f5b46e8f3da3bb55ef1a116a8c24afa7fe2ec85b Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 7 Sep 2019 06:11:27 -0400 Subject: add asset propagation for Data\FarmAnimals (#618) --- src/SMAPI/Metadata/CoreAssetPropagator.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/SMAPI/Metadata') diff --git a/src/SMAPI/Metadata/CoreAssetPropagator.cs b/src/SMAPI/Metadata/CoreAssetPropagator.cs index 5911ba2c..66e6ed14 100644 --- a/src/SMAPI/Metadata/CoreAssetPropagator.cs +++ b/src/SMAPI/Metadata/CoreAssetPropagator.cs @@ -231,6 +231,9 @@ namespace StardewModdingAPI.Metadata CraftingRecipe.craftingRecipes = content.Load>(key); return true; + case "data\\farmanimals": // FarmAnimal constructor + return this.ReloadFarmAnimalData(); + case "data\\npcdispositions": // NPC constructor return this.ReloadNpcDispositions(content, key); @@ -599,6 +602,21 @@ namespace StardewModdingAPI.Metadata return critters.Length; } + /// Reload the data for matching farm animals. + /// Returns whether any farm animals were affected. + /// Derived from the constructor. + private bool ReloadFarmAnimalData() + { + bool changed = false; + foreach (FarmAnimal animal in this.GetFarmAnimals()) + { + animal.reloadData(); + changed = true; + } + + return changed; + } + /// Reload the sprites for a fence type. /// The asset key to reload. /// Returns whether any textures were reloaded. -- cgit