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

@ -22,7 +22,7 @@ namespace MinecraftClient.ChatBots
if (!GetEntityHandlingEnabled())
{
ConsoleIO.WriteLine("[AutoAttack] Entity Handling is not enabled in the config file!");
ConsoleIO.WriteLine("Please enable it to use this bot.");
ConsoleIO.WriteLine("[AutoAttack] This bot will be unloaded.");
UnloadBot();
}
}
@ -53,11 +53,11 @@ namespace MinecraftClient.ChatBots
entitiesToTrack.Add(entity.ID, entity);
}
}
public override void OnEntityDespawn(int EntityID)
public override void OnEntityDespawn(Entity entity)
{
if (entitiesToTrack.ContainsKey(EntityID))
if (entitiesToTrack.ContainsKey(entity.ID))
{
entitiesToTrack.Remove(EntityID);
entitiesToTrack.Remove(entity.ID);
}
}
public override void OnEntityMove(Entity entity)