From 7900108763d86a86188b0dc8940f2cf3b12f7776 Mon Sep 17 00:00:00 2001 From: BruceChen Date: Sun, 11 Dec 2022 17:31:37 +0800 Subject: [PATCH] Bug fix --- MinecraftClient/ChatBots/AutoCraft.cs | 1 + MinecraftClient/ChatBots/AutoDig.cs | 1 + MinecraftClient/ChatBots/AutoDrop.cs | 1 + MinecraftClient/ChatBots/AutoFishing.cs | 1 + MinecraftClient/ChatBots/DiscordBridge.cs | 1 + MinecraftClient/ChatBots/Farmer.cs | 1 + MinecraftClient/ChatBots/FollowPlayer.cs | 1 + MinecraftClient/ChatBots/Mailer.cs | 9 +++++---- MinecraftClient/ChatBots/Map.cs | 1 + MinecraftClient/ChatBots/ReplayCapture.cs | 1 + MinecraftClient/ChatBots/TelegramBridge.cs | 1 + MinecraftClient/Commands/Animation.cs | 1 + MinecraftClient/Commands/Bed.cs | 1 + MinecraftClient/Commands/BlockInfo.cs | 1 + MinecraftClient/Commands/Bots.cs | 1 + MinecraftClient/Commands/ChangeSlot.cs | 1 + MinecraftClient/Commands/Chunk.cs | 1 + MinecraftClient/Commands/Connect.cs | 1 + MinecraftClient/Commands/Debug.cs | 1 + MinecraftClient/Commands/Dig.cs | 1 + MinecraftClient/Commands/DropItem.cs | 1 + MinecraftClient/Commands/Enchant.cs | 1 + MinecraftClient/Commands/Entitycmd.cs | 1 + MinecraftClient/Commands/Exit.cs | 1 + MinecraftClient/Commands/Health.cs | 1 + MinecraftClient/Commands/Inventory.cs | 1 + MinecraftClient/Commands/List.cs | 1 + MinecraftClient/Commands/Look.cs | 1 + MinecraftClient/Commands/Move.cs | 1 + MinecraftClient/Commands/Reco.cs | 1 + MinecraftClient/Commands/Reload.cs | 1 + MinecraftClient/Commands/Respawn.cs | 1 + MinecraftClient/Commands/Script.cs | 1 + MinecraftClient/Commands/Set.cs | 1 + MinecraftClient/Commands/Sneak.cs | 1 + MinecraftClient/Commands/Tps.cs | 1 + MinecraftClient/Commands/Upgrade.cs | 1 + MinecraftClient/Commands/UseItem.cs | 1 + MinecraftClient/Commands/Useblock.cs | 1 + 39 files changed, 43 insertions(+), 4 deletions(-) diff --git a/MinecraftClient/ChatBots/AutoCraft.cs b/MinecraftClient/ChatBots/AutoCraft.cs index 4e9b10a8..52d691ab 100644 --- a/MinecraftClient/ChatBots/AutoCraft.cs +++ b/MinecraftClient/ChatBots/AutoCraft.cs @@ -319,6 +319,7 @@ namespace MinecraftClient.ChatBots .Then(l => l.Literal("stop") .Executes(r => OnCommandStop(r.Source))) .Then(l => l.Literal("_help") + .Executes(r => OnCommandHelp(r.Source, string.Empty)) .Redirect(McClient.dispatcher.GetRoot().GetChild("help").GetChild(CommandName))) ); } diff --git a/MinecraftClient/ChatBots/AutoDig.cs b/MinecraftClient/ChatBots/AutoDig.cs index 859ce35c..cddb6ffd 100644 --- a/MinecraftClient/ChatBots/AutoDig.cs +++ b/MinecraftClient/ChatBots/AutoDig.cs @@ -141,6 +141,7 @@ namespace MinecraftClient.ChatBots .Then(l => l.Literal("stop") .Executes(r => OnCommandStop(r.Source))) .Then(l => l.Literal("_help") + .Executes(r => OnCommandHelp(r.Source, string.Empty)) .Redirect(McClient.dispatcher.GetRoot().GetChild("help").GetChild(CommandName))) ); diff --git a/MinecraftClient/ChatBots/AutoDrop.cs b/MinecraftClient/ChatBots/AutoDrop.cs index 5a301830..36263a86 100644 --- a/MinecraftClient/ChatBots/AutoDrop.cs +++ b/MinecraftClient/ChatBots/AutoDrop.cs @@ -87,6 +87,7 @@ namespace MinecraftClient.ChatBots .Then(l => l.Literal("everything") .Executes(r => OnCommandMode(r.Source, DropMode.everything)))) .Then(l => l.Literal("_help") + .Executes(r => OnCommandHelp(r.Source, string.Empty)) .Redirect(McClient.dispatcher.GetRoot().GetChild("help").GetChild(CommandName))) ); } diff --git a/MinecraftClient/ChatBots/AutoFishing.cs b/MinecraftClient/ChatBots/AutoFishing.cs index ff028536..09ee140f 100644 --- a/MinecraftClient/ChatBots/AutoFishing.cs +++ b/MinecraftClient/ChatBots/AutoFishing.cs @@ -211,6 +211,7 @@ namespace MinecraftClient.ChatBots .Then(l => l.Literal("clear") .Executes(r => OnCommandStatusClear(r.Source)))) .Then(l => l.Literal("_help") + .Executes(r => OnCommandHelp(r.Source, string.Empty)) .Redirect(McClient.dispatcher.GetRoot().GetChild("help").GetChild(CommandName))) ); } diff --git a/MinecraftClient/ChatBots/DiscordBridge.cs b/MinecraftClient/ChatBots/DiscordBridge.cs index a3280bf4..b9d5a50e 100644 --- a/MinecraftClient/ChatBots/DiscordBridge.cs +++ b/MinecraftClient/ChatBots/DiscordBridge.cs @@ -92,6 +92,7 @@ namespace MinecraftClient.ChatBots .Executes(r => OnCommandDirection(r.Source, BridgeDirection.Discord))) ) .Then(l => l.Literal("_help") + .Executes(r => OnCommandHelp(r.Source, string.Empty)) .Redirect(McClient.dispatcher.GetRoot().GetChild("help").GetChild(CommandName))) ); diff --git a/MinecraftClient/ChatBots/Farmer.cs b/MinecraftClient/ChatBots/Farmer.cs index 2bb11817..072fe270 100644 --- a/MinecraftClient/ChatBots/Farmer.cs +++ b/MinecraftClient/ChatBots/Farmer.cs @@ -105,6 +105,7 @@ namespace MinecraftClient.ChatBots .Then(l => l.Argument("OtherArgs", Arguments.GreedyString()) .Executes(r => OnCommandStart(r.Source, MccArguments.GetFarmerCropType(r, "CropType"), Arguments.GetString(r, "OtherArgs")))))) .Then(l => l.Literal("_help") + .Executes(r => OnCommandHelp(r.Source, string.Empty)) .Redirect(McClient.dispatcher.GetRoot().GetChild("help").GetChild(CommandName))) ); } diff --git a/MinecraftClient/ChatBots/FollowPlayer.cs b/MinecraftClient/ChatBots/FollowPlayer.cs index cf707699..0561bf0f 100644 --- a/MinecraftClient/ChatBots/FollowPlayer.cs +++ b/MinecraftClient/ChatBots/FollowPlayer.cs @@ -77,6 +77,7 @@ namespace MinecraftClient.ChatBots .Then(l => l.Literal("stop") .Executes(r => OnCommandStop(r.Source))) .Then(l => l.Literal("_help") + .Executes(r => OnCommandHelp(r.Source, string.Empty)) .Redirect(McClient.dispatcher.GetRoot().GetChild("help").GetChild(CommandName))) ); } diff --git a/MinecraftClient/ChatBots/Mailer.cs b/MinecraftClient/ChatBots/Mailer.cs index aba382d8..41132d71 100644 --- a/MinecraftClient/ChatBots/Mailer.cs +++ b/MinecraftClient/ChatBots/Mailer.cs @@ -5,6 +5,7 @@ using System.IO; using System.Linq; using Brigadier.NET; using Brigadier.NET.Builder; +using MinecraftClient.CommandHandler; using MinecraftClient.CommandHandler.Patch; using MinecraftClient.Scripting; using Tomlet.Attributes; @@ -259,7 +260,7 @@ namespace MinecraftClient.ChatBots McClient.dispatcher.Register(l => l.Literal("help") .Then(l => l.Literal(CommandName) - .Executes(r => OnCommandHelp(string.Empty))) + .Executes(r => OnCommandHelp(r.Source, string.Empty))) ); McClient.dispatcher.Register(l => l.Literal(CommandName) @@ -274,6 +275,7 @@ namespace MinecraftClient.ChatBots .Then(l => l.Argument("username", Arguments.String()) .Executes(r => OnCommandRemoveIgnored(Arguments.GetString(r, "username"))))) .Then(l => l.Literal("_help") + .Executes(r => OnCommandHelp(r.Source, string.Empty)) .Redirect(McClient.dispatcher.GetRoot().GetChild("help").GetChild(CommandName))) ); } @@ -284,16 +286,15 @@ namespace MinecraftClient.ChatBots McClient.dispatcher.GetRoot().GetChild("help").RemoveChild(CommandName); } - private int OnCommandHelp(string cmd) + private int OnCommandHelp(CmdResult r, string? cmd) { - LogToConsole(cmd switch + return r.SetAndReturn(cmd switch { #pragma warning disable format // @formatter:off _ => Translations.bot_mailer_cmd_help + ": /mailer " + '\n' + McClient.dispatcher.GetAllUsageString(CommandName, false), #pragma warning restore format // @formatter:on }); - return 1; } private int OnCommandGetMails() diff --git a/MinecraftClient/ChatBots/Map.cs b/MinecraftClient/ChatBots/Map.cs index 4689c162..fef48a90 100644 --- a/MinecraftClient/ChatBots/Map.cs +++ b/MinecraftClient/ChatBots/Map.cs @@ -94,6 +94,7 @@ namespace MinecraftClient.ChatBots .Then(l => l.Argument("MapID", MccArguments.MapBotMapId()) .Executes(r => OnCommandRender(r.Source, Arguments.GetInteger(r, "MapID"))))) .Then(l => l.Literal("_help") + .Executes(r => OnCommandHelp(r.Source, string.Empty)) .Redirect(McClient.dispatcher.GetRoot().GetChild("help").GetChild(CommandName))) ); } diff --git a/MinecraftClient/ChatBots/ReplayCapture.cs b/MinecraftClient/ChatBots/ReplayCapture.cs index f0a73a3a..eea74911 100644 --- a/MinecraftClient/ChatBots/ReplayCapture.cs +++ b/MinecraftClient/ChatBots/ReplayCapture.cs @@ -58,6 +58,7 @@ namespace MinecraftClient.ChatBots .Then(l => l.Literal("stop") .Executes(r => OnCommandStop(r.Source))) .Then(l => l.Literal("_help") + .Executes(r => OnCommandHelp(r.Source, string.Empty)) .Redirect(McClient.dispatcher.GetRoot().GetChild("help").GetChild(CommandName))) ); } diff --git a/MinecraftClient/ChatBots/TelegramBridge.cs b/MinecraftClient/ChatBots/TelegramBridge.cs index b92572db..6139a8d0 100644 --- a/MinecraftClient/ChatBots/TelegramBridge.cs +++ b/MinecraftClient/ChatBots/TelegramBridge.cs @@ -91,6 +91,7 @@ namespace MinecraftClient.ChatBots .Then(l => l.Literal("telegram") .Executes(r => OnCommandDirection(r.Source, BridgeDirection.Telegram)))) .Then(l => l.Literal("_help") + .Executes(r => OnCommandHelp(r.Source, string.Empty)) .Redirect(McClient.dispatcher.GetRoot().GetChild("help").GetChild(CommandName))) ); diff --git a/MinecraftClient/Commands/Animation.cs b/MinecraftClient/Commands/Animation.cs index f5290e3e..dab51b6f 100644 --- a/MinecraftClient/Commands/Animation.cs +++ b/MinecraftClient/Commands/Animation.cs @@ -29,6 +29,7 @@ namespace MinecraftClient.Commands .Then(l => l.Literal("offhand") .Executes(r => DoAnimation(r.Source, mainhand: false))) .Then(l => l.Literal("_help") + .Executes(r => GetUsage(r.Source, string.Empty)) .Redirect(dispatcher.GetRoot().GetChild("help").GetChild(CmdName))) ); } diff --git a/MinecraftClient/Commands/Bed.cs b/MinecraftClient/Commands/Bed.cs index fbeb15fb..f3d4b995 100644 --- a/MinecraftClient/Commands/Bed.cs +++ b/MinecraftClient/Commands/Bed.cs @@ -37,6 +37,7 @@ namespace MinecraftClient.Commands .Then(l => l.Argument("Radius", Arguments.Double()) .Executes(r => DoSleepBedWithRadius(r.Source, Arguments.GetDouble(r, "Radius"))))) .Then(l => l.Literal("_help") + .Executes(r => GetUsage(r.Source, string.Empty)) .Redirect(dispatcher.GetRoot().GetChild("help").GetChild(CmdName))) ); } diff --git a/MinecraftClient/Commands/BlockInfo.cs b/MinecraftClient/Commands/BlockInfo.cs index 7ced900b..61e177d0 100644 --- a/MinecraftClient/Commands/BlockInfo.cs +++ b/MinecraftClient/Commands/BlockInfo.cs @@ -32,6 +32,7 @@ namespace MinecraftClient.Commands .Then(l => l.Literal("-s") .Executes(r => LogBlockInfo(r.Source, MccArguments.GetLocation(r, "Location"), true)))) .Then(l => l.Literal("_help") + .Executes(r => GetUsage(r.Source, string.Empty)) .Redirect(dispatcher.GetRoot().GetChild("help").GetChild(CmdName))) ); } diff --git a/MinecraftClient/Commands/Bots.cs b/MinecraftClient/Commands/Bots.cs index da9250e4..73574a14 100644 --- a/MinecraftClient/Commands/Bots.cs +++ b/MinecraftClient/Commands/Bots.cs @@ -33,6 +33,7 @@ namespace MinecraftClient.Commands .Then(l => l.Argument("BotName", MccArguments.BotName()) .Executes(r => DoUnloadBot(r.Source, Arguments.GetString(r, "BotName"))))) .Then(l => l.Literal("_help") + .Executes(r => GetUsage(r.Source, string.Empty)) .Redirect(dispatcher.GetRoot().GetChild("help").GetChild(CmdName))) ); } diff --git a/MinecraftClient/Commands/ChangeSlot.cs b/MinecraftClient/Commands/ChangeSlot.cs index d7631f65..acbe2e8d 100644 --- a/MinecraftClient/Commands/ChangeSlot.cs +++ b/MinecraftClient/Commands/ChangeSlot.cs @@ -23,6 +23,7 @@ namespace MinecraftClient.Commands .Then(l => l.Argument("Slot", MccArguments.HotbarSlot()) .Executes(r => DoChangeSlot(r.Source, Arguments.GetInteger(r, "Slot")))) .Then(l => l.Literal("_help") + .Executes(r => GetUsage(r.Source, string.Empty)) .Redirect(dispatcher.GetRoot().GetChild("help").GetChild(CmdName))) ); } diff --git a/MinecraftClient/Commands/Chunk.cs b/MinecraftClient/Commands/Chunk.cs index 58380c9e..3452716b 100644 --- a/MinecraftClient/Commands/Chunk.cs +++ b/MinecraftClient/Commands/Chunk.cs @@ -53,6 +53,7 @@ namespace MinecraftClient.Commands .Then(l => l.Argument("Chunk", MccArguments.Tuple()) .Executes(r => DebugDelete(r.Source, markedChunkPos: MccArguments.GetTuple(r, "Chunk"))))) .Then(l => l.Literal("_help") + .Executes(r => GetUsage(r.Source, string.Empty)) .Redirect(dispatcher.GetRoot().GetChild("help").GetChild(CmdName))) ); } diff --git a/MinecraftClient/Commands/Connect.cs b/MinecraftClient/Commands/Connect.cs index 0224c528..c8691340 100644 --- a/MinecraftClient/Commands/Connect.cs +++ b/MinecraftClient/Commands/Connect.cs @@ -25,6 +25,7 @@ namespace MinecraftClient.Commands .Then(l => l.Argument("AccountNick", MccArguments.AccountNick()) .Executes(r => DoConnect(r.Source, Arguments.GetString(r, "ServerNick"), Arguments.GetString(r, "AccountNick"))))) .Then(l => l.Literal("_help") + .Executes(r => GetUsage(r.Source, string.Empty)) .Redirect(dispatcher.GetRoot().GetChild("help").GetChild(CmdName))) ); } diff --git a/MinecraftClient/Commands/Debug.cs b/MinecraftClient/Commands/Debug.cs index 3517505a..0302ea05 100644 --- a/MinecraftClient/Commands/Debug.cs +++ b/MinecraftClient/Commands/Debug.cs @@ -25,6 +25,7 @@ namespace MinecraftClient.Commands .Then(l => l.Literal("off") .Executes(r => SetDebugMode(r.Source, false, false))) .Then(l => l.Literal("_help") + .Executes(r => GetUsage(r.Source, string.Empty)) .Redirect(dispatcher.GetRoot().GetChild("help").GetChild(CmdName))) ); } diff --git a/MinecraftClient/Commands/Dig.cs b/MinecraftClient/Commands/Dig.cs index 80bf946f..3a30619a 100644 --- a/MinecraftClient/Commands/Dig.cs +++ b/MinecraftClient/Commands/Dig.cs @@ -26,6 +26,7 @@ namespace MinecraftClient.Commands .Then(l => l.Argument("Location", MccArguments.Location()) .Executes(r => DigAt(r.Source, MccArguments.GetLocation(r, "Location")))) .Then(l => l.Literal("_help") + .Executes(r => GetUsage(r.Source, string.Empty)) .Redirect(dispatcher.GetRoot().GetChild("help").GetChild(CmdName))) ); } diff --git a/MinecraftClient/Commands/DropItem.cs b/MinecraftClient/Commands/DropItem.cs index 2ee05f0c..38cfc4b6 100644 --- a/MinecraftClient/Commands/DropItem.cs +++ b/MinecraftClient/Commands/DropItem.cs @@ -26,6 +26,7 @@ namespace MinecraftClient.Commands .Then(l => l.Argument("ItemType", MccArguments.ItemType()) .Executes(r => DoDropItem(r.Source, MccArguments.GetItemType(r, "ItemType")))) .Then(l => l.Literal("_help") + .Executes(r => GetUsage(r.Source, string.Empty)) .Redirect(dispatcher.GetRoot().GetChild("help").GetChild(CmdName))) ); } diff --git a/MinecraftClient/Commands/Enchant.cs b/MinecraftClient/Commands/Enchant.cs index 74e5a5ab..813c734f 100644 --- a/MinecraftClient/Commands/Enchant.cs +++ b/MinecraftClient/Commands/Enchant.cs @@ -34,6 +34,7 @@ namespace MinecraftClient.Commands .Then(l => l.Literal("bottom") .Executes(r => DoEnchant(r.Source, slotId: 2))) .Then(l => l.Literal("_help") + .Executes(r => GetUsage(r.Source, string.Empty)) .Redirect(dispatcher.GetRoot().GetChild("help").GetChild(CmdName))) ); } diff --git a/MinecraftClient/Commands/Entitycmd.cs b/MinecraftClient/Commands/Entitycmd.cs index 19f5fefe..7cd4d8b4 100644 --- a/MinecraftClient/Commands/Entitycmd.cs +++ b/MinecraftClient/Commands/Entitycmd.cs @@ -72,6 +72,7 @@ namespace MinecraftClient.Commands .Then(l => l.Literal("list") .Executes(r => OperateWithType(r.Source, near: false, MccArguments.GetEntityType(r, "EntityType"), ActionType.List)))) .Then(l => l.Literal("_help") + .Executes(r => GetUsage(r.Source, string.Empty)) .Redirect(dispatcher.GetRoot().GetChild("help").GetChild(CmdName))) ); } diff --git a/MinecraftClient/Commands/Exit.cs b/MinecraftClient/Commands/Exit.cs index 281bd980..d2ac389e 100644 --- a/MinecraftClient/Commands/Exit.cs +++ b/MinecraftClient/Commands/Exit.cs @@ -23,6 +23,7 @@ namespace MinecraftClient.Commands .Then(l => l.Argument("ExitCode", Arguments.Integer()) .Executes(r => DoExit(r.Source, Arguments.GetInteger(r, "ExitCode")))) .Then(l => l.Literal("_help") + .Executes(r => GetUsage(r.Source, string.Empty)) .Redirect(dispatcher.GetRoot().GetChild("help").GetChild(CmdName))) ); diff --git a/MinecraftClient/Commands/Health.cs b/MinecraftClient/Commands/Health.cs index 308059b6..21df0efd 100644 --- a/MinecraftClient/Commands/Health.cs +++ b/MinecraftClient/Commands/Health.cs @@ -21,6 +21,7 @@ namespace MinecraftClient.Commands dispatcher.Register(l => l.Literal(CmdName) .Executes(r => LogHealth(r.Source)) .Then(l => l.Literal("_help") + .Executes(r => GetUsage(r.Source, string.Empty)) .Redirect(dispatcher.GetRoot().GetChild("help").GetChild(CmdName))) ); } diff --git a/MinecraftClient/Commands/Inventory.cs b/MinecraftClient/Commands/Inventory.cs index fd13a1c3..9b8325ea 100644 --- a/MinecraftClient/Commands/Inventory.cs +++ b/MinecraftClient/Commands/Inventory.cs @@ -102,6 +102,7 @@ namespace MinecraftClient.Commands .Then(l => l.Literal("all") .Executes(r => DoDropAction(r.Source, inventoryId: null, Arguments.GetInteger(r, "Slot"), WindowActionType.DropItemStack)))))) .Then(l => l.Literal("_help") + .Executes(r => GetUsage(r.Source, string.Empty)) .Redirect(dispatcher.GetRoot().GetChild("help").GetChild(CmdName))) ); } diff --git a/MinecraftClient/Commands/List.cs b/MinecraftClient/Commands/List.cs index b06a4b9a..7e991f55 100644 --- a/MinecraftClient/Commands/List.cs +++ b/MinecraftClient/Commands/List.cs @@ -22,6 +22,7 @@ namespace MinecraftClient.Commands dispatcher.Register(l => l.Literal(CmdName) .Executes(r => DoListPlayers(r.Source)) .Then(l => l.Literal("_help") + .Executes(r => GetUsage(r.Source, string.Empty)) .Redirect(dispatcher.GetRoot().GetChild("help").GetChild(CmdName))) ); } diff --git a/MinecraftClient/Commands/Look.cs b/MinecraftClient/Commands/Look.cs index 5c78f47e..69f0dc2d 100644 --- a/MinecraftClient/Commands/Look.cs +++ b/MinecraftClient/Commands/Look.cs @@ -47,6 +47,7 @@ namespace MinecraftClient.Commands .Then(l => l.Argument("Location", MccArguments.Location()) .Executes(r => LookAtLocation(r.Source, MccArguments.GetLocation(r, "Location")))) .Then(l => l.Literal("_help") + .Executes(r => GetUsage(r.Source, string.Empty)) .Redirect(dispatcher.GetRoot().GetChild("help").GetChild(CmdName))) ); } diff --git a/MinecraftClient/Commands/Move.cs b/MinecraftClient/Commands/Move.cs index 89065765..fa94a06b 100644 --- a/MinecraftClient/Commands/Move.cs +++ b/MinecraftClient/Commands/Move.cs @@ -79,6 +79,7 @@ namespace MinecraftClient.Commands .Then(l => l.Literal("-f") .Executes(r => MoveToLocation(r.Source, MccArguments.GetLocation(r, "location"), true)))) .Then(l => l.Literal("_help") + .Executes(r => GetUsage(r.Source, string.Empty)) .Redirect(dispatcher.GetRoot().GetChild("help").GetChild(CmdName))) ); } diff --git a/MinecraftClient/Commands/Reco.cs b/MinecraftClient/Commands/Reco.cs index 569ca465..482b4e0b 100644 --- a/MinecraftClient/Commands/Reco.cs +++ b/MinecraftClient/Commands/Reco.cs @@ -24,6 +24,7 @@ namespace MinecraftClient.Commands .Then(l => l.Argument("AccountNick", MccArguments.AccountNick()) .Executes(r => DoReconnect(r.Source, Arguments.GetString(r, "AccountNick")))) .Then(l => l.Literal("_help") + .Executes(r => GetUsage(r.Source, string.Empty)) .Redirect(dispatcher.GetRoot().GetChild("help").GetChild(CmdName))) ); } diff --git a/MinecraftClient/Commands/Reload.cs b/MinecraftClient/Commands/Reload.cs index be8ba98d..95359159 100644 --- a/MinecraftClient/Commands/Reload.cs +++ b/MinecraftClient/Commands/Reload.cs @@ -21,6 +21,7 @@ namespace MinecraftClient.Commands dispatcher.Register(l => l.Literal(CmdName) .Executes(r => DoReload(r.Source)) .Then(l => l.Literal("_help") + .Executes(r => GetUsage(r.Source, string.Empty)) .Redirect(dispatcher.GetRoot().GetChild("help").GetChild(CmdName))) ); } diff --git a/MinecraftClient/Commands/Respawn.cs b/MinecraftClient/Commands/Respawn.cs index d494e0b7..f8dd542a 100644 --- a/MinecraftClient/Commands/Respawn.cs +++ b/MinecraftClient/Commands/Respawn.cs @@ -21,6 +21,7 @@ namespace MinecraftClient.Commands dispatcher.Register(l => l.Literal(CmdName) .Executes(r => DoRespawn(r.Source)) .Then(l => l.Literal("_help") + .Executes(r => GetUsage(r.Source, string.Empty)) .Redirect(dispatcher.GetRoot().GetChild("help").GetChild(CmdName))) ); } diff --git a/MinecraftClient/Commands/Script.cs b/MinecraftClient/Commands/Script.cs index 3c8dd07c..d2f310dd 100644 --- a/MinecraftClient/Commands/Script.cs +++ b/MinecraftClient/Commands/Script.cs @@ -23,6 +23,7 @@ namespace MinecraftClient.Commands .Then(l => l.Argument("Script", Arguments.GreedyString()) .Executes(r => DoExecuteScript(r.Source, Arguments.GetString(r, "Script"), null))) .Then(l => l.Literal("_help") + .Executes(r => GetUsage(r.Source, string.Empty)) .Redirect(dispatcher.GetRoot().GetChild("help").GetChild(CmdName))) ); } diff --git a/MinecraftClient/Commands/Set.cs b/MinecraftClient/Commands/Set.cs index e46cfebb..75d8bbd0 100644 --- a/MinecraftClient/Commands/Set.cs +++ b/MinecraftClient/Commands/Set.cs @@ -22,6 +22,7 @@ namespace MinecraftClient.Commands .Then(l => l.Argument("Expression", Arguments.GreedyString()) .Executes(r => DoSetVar(r.Source, Arguments.GetString(r, "Expression")))) .Then(l => l.Literal("_help") + .Executes(r => GetUsage(r.Source, string.Empty)) .Redirect(dispatcher.GetRoot().GetChild("help").GetChild(CmdName))) ); } diff --git a/MinecraftClient/Commands/Sneak.cs b/MinecraftClient/Commands/Sneak.cs index f5401ffb..01d470fa 100644 --- a/MinecraftClient/Commands/Sneak.cs +++ b/MinecraftClient/Commands/Sneak.cs @@ -22,6 +22,7 @@ namespace MinecraftClient.Commands dispatcher.Register(l => l.Literal(CmdName) .Executes(r => DoSneak(r.Source)) .Then(l => l.Literal("_help") + .Executes(r => GetUsage(r.Source, string.Empty)) .Redirect(dispatcher.GetRoot().GetChild("help").GetChild(CmdName))) ); } diff --git a/MinecraftClient/Commands/Tps.cs b/MinecraftClient/Commands/Tps.cs index f96e9674..a30749bb 100644 --- a/MinecraftClient/Commands/Tps.cs +++ b/MinecraftClient/Commands/Tps.cs @@ -22,6 +22,7 @@ namespace MinecraftClient.Commands dispatcher.Register(l => l.Literal(CmdName) .Executes(r => DoLogTps(r.Source)) .Then(l => l.Literal("_help") + .Executes(r => GetUsage(r.Source, string.Empty)) .Redirect(dispatcher.GetRoot().GetChild("help").GetChild(CmdName))) ); } diff --git a/MinecraftClient/Commands/Upgrade.cs b/MinecraftClient/Commands/Upgrade.cs index 30757eaa..35ae3783 100644 --- a/MinecraftClient/Commands/Upgrade.cs +++ b/MinecraftClient/Commands/Upgrade.cs @@ -37,6 +37,7 @@ namespace MinecraftClient.Commands .Then(l => l.Literal("cancel") .Executes(r => CancelDownloadUpdate(r.Source))) .Then(l => l.Literal("_help") + .Executes(r => GetUsage(r.Source, string.Empty)) .Redirect(dispatcher.GetRoot().GetChild("help").GetChild(CmdName))) ); } diff --git a/MinecraftClient/Commands/UseItem.cs b/MinecraftClient/Commands/UseItem.cs index 1768cf38..4a0fe1f6 100644 --- a/MinecraftClient/Commands/UseItem.cs +++ b/MinecraftClient/Commands/UseItem.cs @@ -22,6 +22,7 @@ namespace MinecraftClient.Commands dispatcher.Register(l => l.Literal(CmdName) .Executes(r => DoUseItem(r.Source)) .Then(l => l.Literal("_help") + .Executes(r => GetUsage(r.Source, string.Empty)) .Redirect(dispatcher.GetRoot().GetChild("help").GetChild(CmdName))) ); } diff --git a/MinecraftClient/Commands/Useblock.cs b/MinecraftClient/Commands/Useblock.cs index 1169c994..994e34ae 100644 --- a/MinecraftClient/Commands/Useblock.cs +++ b/MinecraftClient/Commands/Useblock.cs @@ -24,6 +24,7 @@ namespace MinecraftClient.Commands .Then(l => l.Argument("Location", MccArguments.Location()) .Executes(r => UseBlockAtLocation(r.Source, MccArguments.GetLocation(r, "Location")))) .Then(l => l.Literal("_help") + .Executes(r => GetUsage(r.Source, string.Empty)) .Redirect(dispatcher.GetRoot().GetChild("help").GetChild(CmdName))) ); }