diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-02-24 11:28:34 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-02-24 11:28:34 +0100 |
commit | f77720c43f22e347ae9e66302a58b5e3f6a6de58 (patch) | |
tree | 06bb29a7e50aec777969ead2f5ccdf02393c9e1e /src/Protocol/Protocol125.cpp | |
parent | Removed an unused member variable from cChunk. (diff) | |
parent | Maps: Improvements (diff) | |
download | cuberite-f77720c43f22e347ae9e66302a58b5e3f6a6de58.tar cuberite-f77720c43f22e347ae9e66302a58b5e3f6a6de58.tar.gz cuberite-f77720c43f22e347ae9e66302a58b5e3f6a6de58.tar.bz2 cuberite-f77720c43f22e347ae9e66302a58b5e3f6a6de58.tar.lz cuberite-f77720c43f22e347ae9e66302a58b5e3f6a6de58.tar.xz cuberite-f77720c43f22e347ae9e66302a58b5e3f6a6de58.tar.zst cuberite-f77720c43f22e347ae9e66302a58b5e3f6a6de58.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Protocol/Protocol125.cpp | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/Protocol/Protocol125.cpp b/src/Protocol/Protocol125.cpp index 7020699d1..3980350f5 100644 --- a/src/Protocol/Protocol125.cpp +++ b/src/Protocol/Protocol125.cpp @@ -97,6 +97,7 @@ enum PACKET_WINDOW_PROPERTY = 0x69, PACKET_CREATIVE_INVENTORY_ACTION = 0x6B, PACKET_UPDATE_SIGN = 0x82, + PACKET_ITEM_DATA = 0x83, PACKET_PLAYER_LIST_ITEM = 0xC9, PACKET_PLAYER_ABILITIES = 0xca, PACKET_PLUGIN_MESSAGE = 0xfa, @@ -614,6 +615,57 @@ void cProtocol125::SendLogin(const cPlayer & a_Player, const cWorld & a_World) +void cProtocol125::SendMapColumn(int a_ID, int a_X, int a_Y, const Byte * a_Colors, unsigned int a_Length) +{ + cCSLock Lock(m_CSPacket); + + WriteByte (PACKET_ITEM_DATA); + WriteShort(E_ITEM_MAP); + WriteShort(a_ID); + WriteShort(3 + a_Length); + + WriteByte(0); + WriteByte(a_X); + WriteByte(a_Y); + + for (unsigned int i = 0; i < a_Length; ++i) + { + WriteByte(a_Colors[i]); + } + + Flush(); +} + + + + + +void cProtocol125::SendMapDecorators(int a_ID, const cMapDecoratorList & a_Decorators) +{ + cCSLock Lock(m_CSPacket); + + WriteByte (PACKET_ITEM_DATA); + WriteShort(E_ITEM_MAP); + WriteShort(a_ID); + WriteShort(1 + (3 * a_Decorators.size())); + + WriteByte(1); + + for (cMapDecoratorList::const_iterator it = a_Decorators.begin(); it != a_Decorators.end(); ++it) + { + WriteByte((it->GetType() << 4) | (it->GetRot() & 0xf)); + WriteByte(it->GetPixelX()); + WriteByte(it->GetPixelZ()); + } + + Flush(); +} + + + + + + void cProtocol125::SendPickupSpawn(const cPickup & a_Pickup) { cCSLock Lock(m_CSPacket); |