diff --git a/MinecraftClient/ChatBot.cs b/MinecraftClient/ChatBot.cs index ad908ad8..c288c814 100644 --- a/MinecraftClient/ChatBot.cs +++ b/MinecraftClient/ChatBot.cs @@ -230,6 +230,15 @@ namespace MinecraftClient /// Latency. public virtual void OnLatencyUpdate(string playername, Guid uuid, int latency) { } + /// + /// Called when the Latency has been updated for a player + /// + /// Entity + /// Player Name + /// Player UUID + /// Latency. + public virtual void OnLatencyUpdate(Entity entity, string playername, Guid uuid, int latency) { } + /// /// Called when a map was updated /// @@ -876,7 +885,7 @@ namespace MinecraftClient } /// - /// Get all Entityes + /// Get all Entities /// /// All Entities protected Dictionary GetEntities() @@ -884,6 +893,15 @@ namespace MinecraftClient return Handler.GetEntities(); } + /// + /// Get all players Latency + /// + /// All players latency + protected Dictionary GetPlayersLatency() + { + return Handler.GetPlayersLatency(); + } + /// /// Get the current location of the player (Feets location) /// diff --git a/MinecraftClient/McClient.cs b/MinecraftClient/McClient.cs index 3984a3b9..3db0c5a2 100644 --- a/MinecraftClient/McClient.cs +++ b/MinecraftClient/McClient.cs @@ -780,7 +780,7 @@ namespace MinecraftClient } /// - /// Get all Entityes + /// Get all Entities /// /// All Entities public Dictionary GetEntities() @@ -788,6 +788,15 @@ namespace MinecraftClient return entities; } + /// + /// Get all players latency + /// + /// All players latency + public Dictionary GetPlayersLatency() + { + return playersLatency; + } + /// /// Get client player's inventory items /// @@ -2082,6 +2091,7 @@ namespace MinecraftClient if (ent.Value.UUID == uuid && ent.Value.Name == playerName) { ent.Value.Latency = latency; + DispatchBotEvent(bot => bot.OnLatencyUpdate(ent.Value, playerName, uuid, latency)); break; } }