using System; using System.Linq; using StardewModdingAPI; using StardewModdingAPI.Events; using StardewValley; using StardewValley.Characters; namespace Omegasis.NoMorePets { /// The mod entry point. public class NoMorePets : Mod { /********* ** Public methods *********/ /// The mod entry point, called after the mod is first loaded. /// Provides simplified APIs for writing mods. public override void Entry(IModHelper helper) { SaveEvents.AfterLoad += this.SaveEvents_AfterLoad; } /********* ** Private methods *********/ /// The method invoked after the player loads a save. /// The event sender. /// The event data. public void SaveEvents_AfterLoad(object sender, EventArgs e) { foreach (Pet pet in Utility.getAllCharacters().OfType().ToArray()) pet.currentLocation.characters.Remove(pet); } } }