using System; using StardewModdingAPI.Framework; namespace StardewModdingAPI.Events { /// Events serving specialised edge cases that shouldn't be used by most mod. public static class SpecialisedEvents { /********* ** Events *********/ /// Raised when the game updates its state (≈60 times per second), regardless of normal SMAPI validation. This event is not thread-safe and may be invoked while game logic is running asynchronously. Changes to game state in this method may crash the game or corrupt an in-progress save. Do not use this event unless you're fully aware of the context in which your code will be run. Mods using this method will trigger a stability warning in the SMAPI console. public static event EventHandler UnvalidatedUpdateTick; /********* ** Internal methods *********/ /// Raise an event. /// Encapsulates logging and monitoring. internal static void InvokeUnvalidatedUpdateTick(IMonitor monitor) { monitor.SafelyRaisePlainEvent($"{nameof(SpecialisedEvents)}.{nameof(SpecialisedEvents.UnvalidatedUpdateTick)}", SpecialisedEvents.UnvalidatedUpdateTick?.GetInvocationList()); } } }