mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Implement command completion suggestions.
This commit is contained in:
parent
5d2589b10f
commit
84cf749344
115 changed files with 4684 additions and 2695 deletions
|
|
@ -54,7 +54,22 @@ namespace MinecraftClient.Protocol.Handlers.packet.s2c
|
|||
|
||||
Nodes[i] = new(flags, childs, redirectNode, name, paser, suggestionsType);
|
||||
}
|
||||
RootIdx = dataTypes.ReadNextVarInt(packetData);
|
||||
RootIdx = dataTypes.ReadNextVarInt(packetData);
|
||||
|
||||
ConsoleIO.OnDeclareMinecraftCommand(ExtractRootCommand());
|
||||
}
|
||||
|
||||
private static string[] ExtractRootCommand()
|
||||
{
|
||||
List<string> commands = new();
|
||||
CommandNode root = Nodes[RootIdx];
|
||||
foreach (var child in root.Clildren)
|
||||
{
|
||||
string? childName = Nodes[child].Name;
|
||||
if (childName != null)
|
||||
commands.Add(childName);
|
||||
}
|
||||
return commands.ToArray();
|
||||
}
|
||||
|
||||
public static List<Tuple<string, string>> CollectSignArguments(string command)
|
||||
|
|
@ -113,7 +128,7 @@ namespace MinecraftClient.Protocol.Handlers.packet.s2c
|
|||
public string? Name;
|
||||
public Paser? Paser;
|
||||
public string? SuggestionsType;
|
||||
|
||||
|
||||
|
||||
public CommandNode(byte Flags,
|
||||
int[] Clildren,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue