mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
OnPlayerLeave: keep username before deleting (#1181)
This commit is contained in:
parent
4a8fb08f4b
commit
2034729f74
1 changed files with 5 additions and 1 deletions
|
|
@ -1769,12 +1769,16 @@ namespace MinecraftClient
|
|||
/// <param name="uuid">UUID of the player</param>
|
||||
public void OnPlayerLeave(Guid uuid)
|
||||
{
|
||||
string username = null;
|
||||
if (onlinePlayers.ContainsKey(uuid))
|
||||
username = onlinePlayers[uuid];
|
||||
|
||||
lock (onlinePlayers)
|
||||
{
|
||||
onlinePlayers.Remove(uuid);
|
||||
}
|
||||
|
||||
DispatchBotEvent(bot => bot.OnPlayerLeave(uuid, onlinePlayers[uuid]));
|
||||
DispatchBotEvent(bot => bot.OnPlayerLeave(uuid, username));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue