diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-05-19 21:40:56 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-05-19 21:40:56 +0200 |
commit | 42c36429d7cd1e6c3f879b6749e18e912deefe0d (patch) | |
tree | cd6f9a0ddf88a738596018311702d19d07fc0b5c /src/Protocol/Protocol17x.cpp | |
parent | Merge pull request #1010 from mc-server/cactidamage (diff) | |
download | cuberite-42c36429d7cd1e6c3f879b6749e18e912deefe0d.tar cuberite-42c36429d7cd1e6c3f879b6749e18e912deefe0d.tar.gz cuberite-42c36429d7cd1e6c3f879b6749e18e912deefe0d.tar.bz2 cuberite-42c36429d7cd1e6c3f879b6749e18e912deefe0d.tar.lz cuberite-42c36429d7cd1e6c3f879b6749e18e912deefe0d.tar.xz cuberite-42c36429d7cd1e6c3f879b6749e18e912deefe0d.tar.zst cuberite-42c36429d7cd1e6c3f879b6749e18e912deefe0d.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Protocol/Protocol17x.cpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp index 39feee16f..3061d132b 100644 --- a/src/Protocol/Protocol17x.cpp +++ b/src/Protocol/Protocol17x.cpp @@ -289,6 +289,35 @@ void cProtocol172::SendChat(const cCompositeChat & a_Message) AddChatPartStyle(Part, p.m_Style); break; } + + case cCompositeChat::ptShowAchievement: + { + const cCompositeChat::cShowAchievementPart & p = (const cCompositeChat::cShowAchievementPart &)**itr; + Part["translate"] = "chat.type.achievement"; + + Json::Value Ach; + Ach["action"] = "show_achievement"; + Ach["value"] = p.m_Text; + + Json::Value AchColourAndName; + AchColourAndName["color"] = "green"; + AchColourAndName["translate"] = p.m_Text; + AchColourAndName["hoverEvent"] = Ach; + + Json::Value Extra; + Extra.append(AchColourAndName); + + Json::Value Name; + Name["text"] = p.m_PlayerName; + + Json::Value With; + With.append(Name); + With.append(Extra); + + Part["with"] = With; + AddChatPartStyle(Part, p.m_Style); + break; + } } msg["extra"].append(Part); } // for itr - Parts[] |