New entity status packet event (#1506)

This commit is contained in:
ReinforceZwei 2021-03-21 22:17:19 +08:00 committed by GitHub
parent 49603db657
commit c15b071cad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 35 additions and 0 deletions

View file

@ -113,6 +113,7 @@ namespace MinecraftClient
public bool GetNetworkPacketCaptureEnabled() { return networkPacketCaptureEnabled; }
public int GetProtocolVersion() { return protocolversion; }
public ILogger GetLogger() { return this.Log; }
public int GetPlayerEntityID() { return playerEntityID; }
// get bots list for unloading them by commands
public List<ChatBot> GetLoadedChatBots()
@ -2076,6 +2077,19 @@ namespace MinecraftClient
}
}
/// <summary>
/// Called when the status of an entity have been changed
/// </summary>
/// <param name="entityID">Entity ID</param>
/// <param name="status">Status ID</param>
public void OnEntityStatus(int entityID, byte status)
{
if (entityID == playerEntityID)
{
DispatchBotEvent(bot => bot.OnPlayerStatus(status));
}
}
/// <summary>
/// Called when server sent a Time Update packet.
/// </summary>