From 1038f4e7041c18e1af28a627880e760fd2b221fe Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Mon, 13 Feb 2017 02:10:55 -0500 Subject: mark all Command methods deprecated (#199) --- src/StardewModdingAPI/Command.cs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/StardewModdingAPI/Command.cs b/src/StardewModdingAPI/Command.cs index 3b1e5632..1cbb01ff 100644 --- a/src/StardewModdingAPI/Command.cs +++ b/src/StardewModdingAPI/Command.cs @@ -73,6 +73,7 @@ namespace StardewModdingAPI /// Encapsulates monitoring and logging. public static void CallCommand(string input, IMonitor monitor) { + Program.DeprecationManager.Warn("Command.CallCommand", "1.9", DeprecationLevel.Notice); Program.CommandManager.Trigger(input); } @@ -108,6 +109,7 @@ namespace StardewModdingAPI /// The command name to find. public static Command FindCommand(string name) { + Program.DeprecationManager.Warn("Command.FindCommand", "1.9", DeprecationLevel.Notice); if (name == null) return null; @@ -125,15 +127,9 @@ namespace StardewModdingAPI /// The command arguments. private static void Fire(string name, string[] args) { - // get legacy command Command command; if (!Command.LegacyCommands.TryGetValue(name, out command)) - { throw new InvalidOperationException($"Can't run command '{name}' because there's no such legacy command."); - return; - } - - // raise event command.Fire(); } } -- cgit