mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Handle all internal MCC commands in one place
- MCC internal commands for command prompt, remote control and scripts are handled in one place, thus it's no more needed to add them in 3 different places. - "exit" command in scripts is not equivalent to "/quit" - removed "disconnect" command in scripts /!\ - bots can now easily perform internal MCC commands.
This commit is contained in:
parent
283074bb63
commit
9456e82923
4 changed files with 144 additions and 86 deletions
|
|
@ -75,11 +75,34 @@ namespace MinecraftClient
|
|||
/// Send text to the server. Can be anything such as chat messages or commands
|
||||
/// </summary>
|
||||
/// <param name="text">Text to send to the server</param>
|
||||
/// <returns>True if the text was sent with no error</returns>
|
||||
|
||||
protected void SendText(string text)
|
||||
protected bool SendText(string text)
|
||||
{
|
||||
ConsoleIO.WriteLineFormatted("§8BOT:" + text, false);
|
||||
handler.SendChatMessage(text);
|
||||
return handler.SendChatMessage(text);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if the given command is a valid internal MCC command
|
||||
/// </summary>
|
||||
/// <param name="command">The command or command name</param>
|
||||
/// <returns>TRUE if this is an internal command</returns>
|
||||
|
||||
protected bool isInternalCommand(string command)
|
||||
{
|
||||
return handler.isInternalCommand(command);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Perform an internal MCC command (not a server command, use SendText() instead for that!)
|
||||
/// </summary>
|
||||
/// <param name="command">The command</param>
|
||||
/// <returns>TRUE if the command was successfully recognized and performed</returns>
|
||||
|
||||
protected bool performInternalCommand(string command)
|
||||
{
|
||||
return handler.performInternalCommand(command);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue