Add player join/leave event to ChatBot API (#1181)

* Add player join/leave event to ChatBot API (#1180)
* Add method documentation
* Dispatch Join/Leave after updating player list
Co-authored-by: ORelio <ORelio@users.noreply.github.com>
This commit is contained in:
ReinforceZwei 2020-08-06 21:57:23 +08:00 committed by GitHub
parent a17d60047a
commit 4a8fb08f4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

View file

@ -1759,6 +1759,8 @@ namespace MinecraftClient
{
onlinePlayers[uuid] = name;
}
DispatchBotEvent(bot => bot.OnPlayerJoin(uuid, name));
}
/// <summary>
@ -1771,6 +1773,8 @@ namespace MinecraftClient
{
onlinePlayers.Remove(uuid);
}
DispatchBotEvent(bot => bot.OnPlayerLeave(uuid, onlinePlayers[uuid]));
}
/// <summary>