Made ChatBotAPI OnEntityDespawn to pass Entity object instead of EntityID

This commit is contained in:
ReinforceZwei 2020-03-24 15:03:32 +08:00 committed by ORelio
parent dbf5334758
commit 7fbf9443a1
4 changed files with 9 additions and 10 deletions

View file

@ -1115,12 +1115,12 @@ namespace MinecraftClient
{
foreach (int a in Entities)
{
foreach (ChatBot bot in bots.ToArray())
bot.OnEntityDespawn(new Entity(entities[a].ID, entities[a].Type, entities[a].Location));
if (entities.ContainsKey(a))
{
entities.Remove(a);
}
foreach (ChatBot bot in bots.ToArray())
bot.OnEntityDespawn(a);
}
}