diff options
author | Scott Moore <scott.will.moore@gmail.com> | 2015-04-07 16:41:19 +0200 |
---|---|---|
committer | Scott Moore <scott.will.moore@gmail.com> | 2015-04-13 08:22:51 +0200 |
commit | 8c144207dc6bcbc9871c3a577b864f7c3fcd074c (patch) | |
tree | a85263b4b555a41ec16809c7b84f204fba1473f0 /src/Protocol/Protocol18x.cpp | |
parent | Fixed the nether and end getting snow if they were generated in the overworld. (diff) | |
download | cuberite-8c144207dc6bcbc9871c3a577b864f7c3fcd074c.tar cuberite-8c144207dc6bcbc9871c3a577b864f7c3fcd074c.tar.gz cuberite-8c144207dc6bcbc9871c3a577b864f7c3fcd074c.tar.bz2 cuberite-8c144207dc6bcbc9871c3a577b864f7c3fcd074c.tar.lz cuberite-8c144207dc6bcbc9871c3a577b864f7c3fcd074c.tar.xz cuberite-8c144207dc6bcbc9871c3a577b864f7c3fcd074c.tar.zst cuberite-8c144207dc6bcbc9871c3a577b864f7c3fcd074c.zip |
Diffstat (limited to 'src/Protocol/Protocol18x.cpp')
-rw-r--r-- | src/Protocol/Protocol18x.cpp | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/src/Protocol/Protocol18x.cpp b/src/Protocol/Protocol18x.cpp index a1ca25200..20b55f461 100644 --- a/src/Protocol/Protocol18x.cpp +++ b/src/Protocol/Protocol18x.cpp @@ -542,6 +542,18 @@ void cProtocol180::SendHealth(void) +void cProtocol180::SendHideTitle(void) +{ + ASSERT(m_State == 3); // In game mode? + + cPacketizer Pkt(*this, 0x45); // Title packet + Pkt.WriteVarInt32(3); // Hide title +} + + + + + void cProtocol180::SendInventorySlot(char a_WindowID, short a_SlotNum, const cItem & a_Item) { ASSERT(m_State == 3); // In game mode? @@ -1021,6 +1033,18 @@ void cProtocol180::SendRemoveEntityEffect(const cEntity & a_Entity, int a_Effect +void cProtocol180::SendResetTitle(void) +{ + ASSERT(m_State == 3); // In game mode? + + cPacketizer Pkt(*this, 0x45); // Title packet + Pkt.WriteVarInt32(4); // Reset title +} + + + + + void cProtocol180::SendRespawn(eDimension a_Dimension, bool a_ShouldIgnoreDimensionChecks) { if ((m_LastSentDimension == a_Dimension) && !a_ShouldIgnoreDimensionChecks) @@ -1123,6 +1147,52 @@ void cProtocol180::SendDisplayObjective(const AString & a_Objective, cScoreboard +void cProtocol180::SendSetSubTitle(const cCompositeChat & a_SubTitle) +{ + SendSetRawSubTitle(a_SubTitle.CreateJsonString(false)); +} + + + + + +void cProtocol180::SendSetRawSubTitle(const AString & a_SubTitle) +{ + ASSERT(m_State == 3); // In game mode? + + cPacketizer Pkt(*this, 0x45); // Title packet + Pkt.WriteVarInt32(1); // Set subtitle + + Pkt.WriteString(a_SubTitle); +} + + + + + +void cProtocol180::SendSetTitle(const cCompositeChat & a_Title) +{ + SendSetRawTitle(a_Title.CreateJsonString(false)); +} + + + + + +void cProtocol180::SendSetRawTitle(const AString & a_Title) +{ + ASSERT(m_State == 3); // In game mode? + + cPacketizer Pkt(*this, 0x45); // Title packet + Pkt.WriteVarInt32(0); // Set title + + Pkt.WriteString(a_Title); +} + + + + + void cProtocol180::SendSoundEffect(const AString & a_SoundName, double a_X, double a_Y, double a_Z, float a_Volume, float a_Pitch) { ASSERT(m_State == 3); // In game mode? @@ -1330,6 +1400,22 @@ void cProtocol180::SendThunderbolt(int a_BlockX, int a_BlockY, int a_BlockZ) +void cProtocol180::SendTitleTimes(int a_FadeInTicks, int a_DisplayTicks, int a_FadeOutTicks) +{ + ASSERT(m_State == 3); // In game mode? + + cPacketizer Pkt(*this, 0x45); // Title packet + Pkt.WriteVarInt32(2); // Set title display times + + Pkt.WriteBEInt32(a_FadeInTicks); + Pkt.WriteBEInt32(a_DisplayTicks); + Pkt.WriteBEInt32(a_FadeOutTicks); +} + + + + + void cProtocol180::SendTimeUpdate(Int64 a_WorldAge, Int64 a_TimeOfDay, bool a_DoDaylightCycle) { ASSERT(m_State == 3); // In game mode? |