using Omegasis.AutoSpeed.Framework; using StardewModdingAPI; using StardewModdingAPI.Events; using StardewValley; namespace Omegasis.AutoSpeed { /// The mod entry point. public class AutoSpeed : Mod { /********* ** Fields *********/ /// The mod configuration. private ModConfig Config; /********* ** 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.UpdateTicked += this.OnUpdateTicked; this.Config = helper.ReadConfig(); } /********* ** Private methods *********/ /// Raised after the game state is updated (≈60 times per second). /// The event sender. /// The event arguments. private void OnUpdateTicked(object sender, UpdateTickedEventArgs e) { if (Context.IsPlayerFree) Game1.player.addedSpeed = this.Config.Speed; } } }