summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol125.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Protocol/Protocol125.cpp')
-rw-r--r--src/Protocol/Protocol125.cpp31
1 files changed, 9 insertions, 22 deletions
diff --git a/src/Protocol/Protocol125.cpp b/src/Protocol/Protocol125.cpp
index 69f4934d8..fe6280218 100644
--- a/src/Protocol/Protocol125.cpp
+++ b/src/Protocol/Protocol125.cpp
@@ -239,32 +239,11 @@ void cProtocol125::SendChat(const AString & a_Message)
void cProtocol125::SendChat(const cCompositeChat & a_Message)
{
// This version doesn't support composite messages, just extract each part's text and use it:
- AString Msg;
- const cCompositeChat::cParts & Parts = a_Message.GetParts();
- for (cCompositeChat::cParts::const_iterator itr = Parts.begin(), end = Parts.end(); itr != end; ++itr)
- {
- switch ((*itr)->m_PartType)
- {
- case cCompositeChat::ptText:
- case cCompositeChat::ptClientTranslated:
- case cCompositeChat::ptRunCommand:
- case cCompositeChat::ptSuggestCommand:
- {
- Msg.append((*itr)->m_Text);
- break;
- }
- case cCompositeChat::ptUrl:
- {
- Msg.append(((cCompositeChat::cUrlPart *)(*itr))->m_Url);
- break;
- }
- } // switch (PartType)
- } // for itr - Parts[]
// Send the message:
cCSLock Lock(m_CSPacket);
WriteByte (PACKET_CHAT);
- WriteString(Msg);
+ WriteString(a_Message.ExtractText());
Flush();
}
@@ -1972,6 +1951,14 @@ void cProtocol125::WriteMobMetadata(const cMonster & a_Mob)
WriteByte(((const cWitch &)a_Mob).IsAngry() ? 1 : 0); // Aggravated? Doesn't seem to do anything
break;
}
+ case cMonster::mtWither:
+ {
+ WriteByte(0x54); // Int at index 20
+ WriteInt(((const cWither &)a_Mob).GetNumInvulnerableTicks());
+ WriteByte(0x66); // Float at index 6
+ WriteFloat((float)(a_Mob.GetHealth()));
+ break;
+ }
case cMonster::mtSlime:
case cMonster::mtMagmaCube:
{