mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
parent
b848460a5c
commit
bab472df05
1 changed files with 23 additions and 23 deletions
|
|
@ -26,7 +26,7 @@ namespace MinecraftClient
|
|||
private readonly Dictionary<Guid, string> onlinePlayers = new Dictionary<Guid, string>();
|
||||
|
||||
private readonly List<ChatBot> bots = new List<ChatBot>();
|
||||
private static readonly List<ChatBots.Script> scripts_on_hold = new List<ChatBots.Script>();
|
||||
private static readonly List<ChatBot> botsOnHold = new List<ChatBot>();
|
||||
|
||||
private readonly Dictionary<string, List<ChatBot>> registeredBotPluginChannels = new Dictionary<string, List<ChatBot>>();
|
||||
private readonly List<string> registeredServerPluginChannels = new List<String>();
|
||||
|
|
@ -108,6 +108,8 @@ namespace MinecraftClient
|
|||
this.port = port;
|
||||
|
||||
if (!singlecommand)
|
||||
{
|
||||
if (botsOnHold.Count == 0)
|
||||
{
|
||||
if (Settings.AntiAFK_Enabled) { BotLoad(new ChatBots.AntiAFK(Settings.AntiAFK_Delay)); }
|
||||
if (Settings.Hangman_Enabled) { BotLoad(new ChatBots.HangmanGame(Settings.Hangman_English)); }
|
||||
|
|
@ -121,6 +123,7 @@ namespace MinecraftClient
|
|||
//Add your ChatBot here by uncommenting and adapting
|
||||
//BotLoad(new ChatBots.YourBot());
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
|
@ -143,10 +146,9 @@ namespace MinecraftClient
|
|||
}
|
||||
else
|
||||
{
|
||||
foreach (ChatBot bot in scripts_on_hold)
|
||||
bot.SetHandler(this);
|
||||
bots.AddRange(scripts_on_hold);
|
||||
scripts_on_hold.Clear();
|
||||
foreach (ChatBot bot in botsOnHold)
|
||||
BotLoad(bot, false);
|
||||
botsOnHold.Clear();
|
||||
|
||||
Console.WriteLine("Server was successfully joined.\nType '"
|
||||
+ (Settings.internalCmdChar == ' ' ? "" : "" + Settings.internalCmdChar)
|
||||
|
|
@ -310,9 +312,8 @@ namespace MinecraftClient
|
|||
/// </summary>
|
||||
public void Disconnect()
|
||||
{
|
||||
foreach (ChatBot bot in bots)
|
||||
if (bot is ChatBots.Script)
|
||||
scripts_on_hold.Add((ChatBots.Script)bot);
|
||||
botsOnHold.Clear();
|
||||
botsOnHold.AddRange(bots);
|
||||
|
||||
if (handler != null)
|
||||
{
|
||||
|
|
@ -332,15 +333,14 @@ namespace MinecraftClient
|
|||
/// <summary>
|
||||
/// Load a new bot
|
||||
/// </summary>
|
||||
public void BotLoad(ChatBot b)
|
||||
public void BotLoad(ChatBot b, bool init = true)
|
||||
{
|
||||
b.SetHandler(this);
|
||||
bots.Add(b);
|
||||
if (init)
|
||||
b.Initialize();
|
||||
if (this.handler != null)
|
||||
{
|
||||
b.AfterGameJoined();
|
||||
}
|
||||
Settings.SingleCommand = "";
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue