summaryrefslogtreecommitdiff
path: root/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-02-01 16:21:35 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-02-01 16:21:35 -0500
commitc8d627cdf2ae3126584ec2500877ff19987db17f (patch)
tree2cc6f604df00027239476acf3a74ae6bb0761323 /src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World
parentf976b5c0f095a881fc20f6ce5dcf5a50ebb2b5da (diff)
parent17a9193fd28c527dcba40360702adb277736cc45 (diff)
downloadSMAPI-c8d627cdf2ae3126584ec2500877ff19987db17f.tar.gz
SMAPI-c8d627cdf2ae3126584ec2500877ff19987db17f.tar.bz2
SMAPI-c8d627cdf2ae3126584ec2500877ff19987db17f.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World')
-rw-r--r--src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/FreezeTimeCommand.cs15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/FreezeTimeCommand.cs b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/FreezeTimeCommand.cs
index 6a7ab162..736a93a0 100644
--- a/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/FreezeTimeCommand.cs
+++ b/src/SMAPI.Mods.ConsoleCommands/Framework/Commands/World/FreezeTimeCommand.cs
@@ -1,4 +1,4 @@
-using System.Linq;
+using System.Linq;
using StardewValley;
namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.World
@@ -17,18 +17,11 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.World
/*********
- ** Accessors
- *********/
- /// <summary>Whether the command needs to perform logic when the game updates.</summary>
- public override bool NeedsUpdate => this.FreezeTime;
-
-
- /*********
** Public methods
*********/
/// <summary>Construct an instance.</summary>
public FreezeTimeCommand()
- : base("world_freezetime", "Freezes or resumes time.\n\nUsage: world_freezetime [value]\n- value: one of 0 (resume), 1 (freeze), or blank (toggle).") { }
+ : base("world_freezetime", "Freezes or resumes time.\n\nUsage: world_freezetime [value]\n- value: one of 0 (resume), 1 (freeze), or blank (toggle).", mayNeedUpdate: true) { }
/// <summary>Handle the command.</summary>
/// <param name="monitor">Writes messages to the console and log file.</param>
@@ -57,9 +50,9 @@ namespace StardewModdingAPI.Mods.ConsoleCommands.Framework.Commands.World
/// <summary>Perform any logic needed on update tick.</summary>
/// <param name="monitor">Writes messages to the console and log file.</param>
- public override void Update(IMonitor monitor)
+ public override void OnUpdated(IMonitor monitor)
{
- if (this.FreezeTime)
+ if (this.FreezeTime && Context.IsWorldReady)
Game1.timeOfDay = FreezeTimeCommand.FrozenTime;
}
}