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/Protocol17x.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 'src/Protocol/Protocol17x.cpp')
-rw-r--r-- | src/Protocol/Protocol17x.cpp | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp index aaf8830cd..992023464 100644 --- a/src/Protocol/Protocol17x.cpp +++ b/src/Protocol/Protocol17x.cpp @@ -587,6 +587,61 @@ void cProtocol172::SendPaintingSpawn(const cPainting & a_Painting) +void cProtocol172::SendMapColumn(int a_ID, int a_X, int a_Y, const Byte * a_Colors, unsigned int a_Length) +{ + cPacketizer Pkt(*this, 0x34); + Pkt.WriteVarInt(a_ID); + Pkt.WriteShort (3 + a_Length); + + Pkt.WriteByte(0); + Pkt.WriteByte(a_X); + Pkt.WriteByte(a_Y); + + for (unsigned int i = 0; i < a_Length; ++i) + { + Pkt.WriteByte(a_Colors[i]); + } +} + + + + + +void cProtocol172::SendMapDecorators(int a_ID, const cMapDecoratorList & a_Decorators) +{ + cPacketizer Pkt(*this, 0x34); + Pkt.WriteVarInt(a_ID); + Pkt.WriteShort (1 + (3 * a_Decorators.size())); + + Pkt.WriteByte(1); + + for (cMapDecoratorList::const_iterator it = a_Decorators.begin(); it != a_Decorators.end(); ++it) + { + Pkt.WriteByte((it->GetType() << 4) | (it->GetRot() & 0xf)); + Pkt.WriteByte(it->GetPixelX()); + Pkt.WriteByte(it->GetPixelZ()); + } +} + + + + + +void cProtocol172::SendMapInfo(int a_ID, unsigned int a_Scale) +{ + cPacketizer Pkt(*this, 0x34); + Pkt.WriteVarInt(a_ID); + Pkt.WriteShort (2); + + Pkt.WriteByte(2); + Pkt.WriteByte(a_Scale); +} + + + + + + void cProtocol172::SendPickupSpawn(const cPickup & a_Pickup) { { |