mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Add config setting for AutoCraft
This commit is contained in:
parent
d71fb88d93
commit
6967f6928b
3 changed files with 27 additions and 6 deletions
|
|
@ -158,7 +158,13 @@ namespace MinecraftClient.ChatBots
|
|||
|
||||
public override void Initialize()
|
||||
{
|
||||
if (!GetInventoryEnabled())
|
||||
{
|
||||
ConsoleIO.WriteLogLine("Inventory handling is disabled. AutoCraft will be unloaded");
|
||||
UnloadBot();
|
||||
}
|
||||
RegisterChatBotCommand("autocraft", "auto craft", CommandHandler);
|
||||
LoadConfig();
|
||||
}
|
||||
|
||||
public string CommandHandler(string cmd, string[] args)
|
||||
|
|
@ -244,16 +250,16 @@ namespace MinecraftClient.ChatBots
|
|||
Directory.CreateDirectory(@"autocraft");
|
||||
}
|
||||
WriteDefaultConfig();
|
||||
ConsoleIO.WriteLogLine("No config found. Writing a new one.");
|
||||
ConsoleIO.WriteLogLine("[AutoCraft] No config found. Writing a new one.");
|
||||
}
|
||||
try
|
||||
{
|
||||
ParseConfig();
|
||||
ConsoleIO.WriteLogLine("Successfully loaded");
|
||||
ConsoleIO.WriteLogLine("[AutoCraft] Successfully loaded");
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
ConsoleIO.WriteLogLine("Error while parsing config: \n" + e.Message);
|
||||
ConsoleIO.WriteLogLine("[AutoCraft] Error while parsing config: \n" + e.Message);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue