Merge pull request #3216 from xiaozeqwq/patch-5

Backup bots before unloading on transfer initiation
This commit is contained in:
Anon 2026-08-29 14:38:02 +02:00 committed by GitHub
commit a2ab4bd5ea
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -436,6 +436,12 @@ namespace MinecraftClient
ResolveTransferAddress(ref resolvedHost, ref resolvedPort);
Log.Info($"Initiating a transfer to: {resolvedHost}:{resolvedPort}");
// Backup current bots before unloading, so they can be restored after successful transfer.
if (botsOnHold.Count == 0 && bots.Count > 0)
{
botsOnHold.AddRange(bots.Where(bot => bot.ScriptOwnerKey is null));
}
// Unload bots
UnloadAllBots();
bots.Clear();