mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Implement tab list display name update
Packet 0x2D with action 0x03
This commit is contained in:
parent
461385d057
commit
b1d4f85b23
4 changed files with 31 additions and 7 deletions
|
|
@ -447,8 +447,17 @@ namespace MinecraftClient.Protocol.Handlers
|
|||
readNextVarInt(packetData);
|
||||
break;
|
||||
case 0x03: //Update display name
|
||||
if (readNextBool(packetData))
|
||||
readNextString(packetData);
|
||||
bool hasDisplayName = readNextBool(packetData);
|
||||
string newDisplayName = null;
|
||||
if (hasDisplayName)
|
||||
newDisplayName = readNextString(packetData);
|
||||
PlayerInfo player = handler.GetPlayer(uuid);
|
||||
if (player != null)
|
||||
{
|
||||
if (hasDisplayName)
|
||||
player.DisplayName = newDisplayName;
|
||||
else player.DisplayName = player.Name;
|
||||
}
|
||||
break;
|
||||
case 0x04: //Player Leave
|
||||
handler.OnPlayerLeave(uuid);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue