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)
{
helper.Events.GameLoop.SaveLoaded += this.OnSaveLoaded;
}
/*********
** Private methods
*********/
/// Raised after the player loads a save slot and the world is initialised.
/// The event sender.
/// The event arguments.
public void OnSaveLoaded(object sender, SaveLoadedEventArgs e)
{
foreach (Pet pet in Game1.player.currentLocation.getCharacters().OfType().ToArray())
pet.currentLocation.characters.Remove(pet);
}
}
}