mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Added Player Killed event (Combat and CombatDeath packets).
This commit is contained in:
parent
01eee22921
commit
80e227c3a7
5 changed files with 65 additions and 1 deletions
|
|
@ -596,6 +596,33 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
Acknowledge(chat);
|
||||
handler.OnTextReceived(chat);
|
||||
}
|
||||
break;
|
||||
case PacketTypesIn.CombatEvent:
|
||||
// 1.8 - 1.16.5
|
||||
if (protocolVersion >= MC_1_8_Version && protocolVersion <= MC_1_16_5_Version)
|
||||
{
|
||||
CombatEventType eventType = (CombatEventType)dataTypes.ReadNextVarInt(packetData);
|
||||
|
||||
if (eventType == CombatEventType.EntityDead)
|
||||
{
|
||||
dataTypes.SkipNextVarInt(packetData);
|
||||
|
||||
handler.OnPlayerKilled(
|
||||
dataTypes.ReadNextInt(packetData),
|
||||
ChatParser.ParseText(dataTypes.ReadNextString(packetData))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
case PacketTypesIn.DeathCombatEvent:
|
||||
dataTypes.SkipNextVarInt(packetData);
|
||||
|
||||
handler.OnPlayerKilled(
|
||||
dataTypes.ReadNextInt(packetData),
|
||||
ChatParser.ParseText(dataTypes.ReadNextString(packetData))
|
||||
);
|
||||
|
||||
break;
|
||||
case PacketTypesIn.MessageHeader:
|
||||
if (protocolVersion >= MC_1_19_2_Version)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue