mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
New entity status packet event (#1506)
This commit is contained in:
parent
49603db657
commit
c15b071cad
4 changed files with 35 additions and 0 deletions
|
|
@ -335,6 +335,12 @@ namespace MinecraftClient
|
||||||
/// <param name="protocolversion">Ptotocol version</param>
|
/// <param name="protocolversion">Ptotocol version</param>
|
||||||
public virtual void OnEntityMetadata(Entity entity, Dictionary<int, object> metadata) { }
|
public virtual void OnEntityMetadata(Entity entity, Dictionary<int, object> metadata) { }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called when the status of client player have been changed
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="statusId"></param>
|
||||||
|
public virtual void OnPlayerStatus(byte statusId) { }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when a network packet received or sent
|
/// Called when a network packet received or sent
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -113,6 +113,7 @@ namespace MinecraftClient
|
||||||
public bool GetNetworkPacketCaptureEnabled() { return networkPacketCaptureEnabled; }
|
public bool GetNetworkPacketCaptureEnabled() { return networkPacketCaptureEnabled; }
|
||||||
public int GetProtocolVersion() { return protocolversion; }
|
public int GetProtocolVersion() { return protocolversion; }
|
||||||
public ILogger GetLogger() { return this.Log; }
|
public ILogger GetLogger() { return this.Log; }
|
||||||
|
public int GetPlayerEntityID() { return playerEntityID; }
|
||||||
|
|
||||||
// get bots list for unloading them by commands
|
// get bots list for unloading them by commands
|
||||||
public List<ChatBot> GetLoadedChatBots()
|
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>
|
/// <summary>
|
||||||
/// Called when server sent a Time Update packet.
|
/// Called when server sent a Time Update packet.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
|
|
@ -1006,6 +1006,14 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
handler.OnEntityMetadata(EntityID, metadata);
|
handler.OnEntityMetadata(EntityID, metadata);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case PacketTypesIn.EntityStatus:
|
||||||
|
if (handler.GetEntityHandlingEnabled())
|
||||||
|
{
|
||||||
|
int entityId = dataTypes.ReadNextInt(packetData);
|
||||||
|
byte status = dataTypes.ReadNextByte(packetData);
|
||||||
|
handler.OnEntityStatus(entityId, status);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case PacketTypesIn.TimeUpdate:
|
case PacketTypesIn.TimeUpdate:
|
||||||
long WorldAge = dataTypes.ReadNextLong(packetData);
|
long WorldAge = dataTypes.ReadNextLong(packetData);
|
||||||
long TimeOfday = dataTypes.ReadNextLong(packetData);
|
long TimeOfday = dataTypes.ReadNextLong(packetData);
|
||||||
|
|
|
||||||
|
|
@ -209,6 +209,13 @@ namespace MinecraftClient.Protocol
|
||||||
/// <param name="prop">Dictionary of properties</param>
|
/// <param name="prop">Dictionary of properties</param>
|
||||||
void OnEntityProperties(int entityID, Dictionary<string, Double> prop);
|
void OnEntityProperties(int entityID, Dictionary<string, Double> prop);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Called when the status of an entity have been changed
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="entityID">Entity ID</param>
|
||||||
|
/// <param name="status">Status ID</param>
|
||||||
|
void OnEntityStatus(int entityID, byte status);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when the world age has been updated
|
/// Called when the world age has been updated
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue