Remove tab display name experiment (not working)

- Tab display names should hold display name but...
 - Server sends <UUID, name, null> x Player count
 - TabListPlus sends <SlotID, ???tab#01, SlotText> x Slot Count
 - So we don't have player display names, only worthless slots
 - So the whole feature was useless, reverting to name only.
This commit is contained in:
ORelio 2016-08-27 15:46:34 +02:00
parent 61ce935c63
commit 2a07fbbae6
9 changed files with 18 additions and 141 deletions

View file

@ -437,27 +437,17 @@ namespace MinecraftClient.Protocol.Handlers
}
readNextVarInt(packetData);
readNextVarInt(packetData);
string displayName = name;
if (readNextBool(packetData))
displayName = readNextString(packetData);
handler.OnPlayerJoin(new PlayerInfo(uuid, name, displayName));
readNextString(packetData);
handler.OnPlayerJoin(uuid, name);
break;
case 0x01: //Update gamemode
case 0x02: //Update latency
readNextVarInt(packetData);
break;
case 0x03: //Update display name
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;
}
if (readNextBool(packetData))
readNextString(packetData);
break;
case 0x04: //Player Leave
handler.OnPlayerLeave(uuid);
@ -475,7 +465,7 @@ namespace MinecraftClient.Protocol.Handlers
short ping = readNextShort(packetData);
Guid FakeUUID = new Guid(MD5.Create().ComputeHash(Encoding.UTF8.GetBytes(name)).Take(16).ToArray());
if (online)
handler.OnPlayerJoin(new PlayerInfo(FakeUUID, name));
handler.OnPlayerJoin(FakeUUID, name);
else handler.OnPlayerLeave(FakeUUID);
}
break;