summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol18x.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-09-13 02:20:04 +0200
committerHowaner <franzi.moos@googlemail.com>2014-09-13 02:20:04 +0200
commitb462416e1fef58b3ddccc92f3dfe613fc27d5483 (patch)
treeaf9097c1ca4b284ac0342fc01f221be2fd1240b0 /src/Protocol/Protocol18x.cpp
parentMerge branch 'master' into 1.8-Protocol (diff)
downloadcuberite-b462416e1fef58b3ddccc92f3dfe613fc27d5483.tar
cuberite-b462416e1fef58b3ddccc92f3dfe613fc27d5483.tar.gz
cuberite-b462416e1fef58b3ddccc92f3dfe613fc27d5483.tar.bz2
cuberite-b462416e1fef58b3ddccc92f3dfe613fc27d5483.tar.lz
cuberite-b462416e1fef58b3ddccc92f3dfe613fc27d5483.tar.xz
cuberite-b462416e1fef58b3ddccc92f3dfe613fc27d5483.tar.zst
cuberite-b462416e1fef58b3ddccc92f3dfe613fc27d5483.zip
Diffstat (limited to 'src/Protocol/Protocol18x.cpp')
-rw-r--r--src/Protocol/Protocol18x.cpp31
1 files changed, 15 insertions, 16 deletions
diff --git a/src/Protocol/Protocol18x.cpp b/src/Protocol/Protocol18x.cpp
index 735700dda..b3cdcc7bc 100644
--- a/src/Protocol/Protocol18x.cpp
+++ b/src/Protocol/Protocol18x.cpp
@@ -728,18 +728,21 @@ void cProtocol180::SendPaintingSpawn(const cPainting & a_Painting)
-void cProtocol180::SendMapColumn(int a_ID, int a_X, int a_Y, const Byte * a_Colors, unsigned int a_Length)
+void cProtocol180::SendMapColumn(int a_ID, int a_X, int a_Y, const Byte * a_Colors, unsigned int a_Length, unsigned int m_Scale)
{
ASSERT(m_State == 3); // In game mode?
cPacketizer Pkt(*this, 0x34);
Pkt.WriteVarInt(a_ID);
- Pkt.WriteShort (3 + a_Length);
+ Pkt.WriteByte(m_Scale);
- Pkt.WriteByte(0);
+ Pkt.WriteVarInt(0);
+ Pkt.WriteByte(1);
+ Pkt.WriteByte(a_Length);
Pkt.WriteByte(a_X);
Pkt.WriteByte(a_Y);
-
+
+ Pkt.WriteVarInt(a_Length);
for (unsigned int i = 0; i < a_Length; ++i)
{
Pkt.WriteByte(a_Colors[i]);
@@ -750,22 +753,23 @@ void cProtocol180::SendMapColumn(int a_ID, int a_X, int a_Y, const Byte * a_Colo
-void cProtocol180::SendMapDecorators(int a_ID, const cMapDecoratorList & a_Decorators)
+void cProtocol180::SendMapDecorators(int a_ID, const cMapDecoratorList & a_Decorators, unsigned int m_Scale)
{
ASSERT(m_State == 3); // In game mode?
cPacketizer Pkt(*this, 0x34);
Pkt.WriteVarInt(a_ID);
- Pkt.WriteShort ((short)(1 + (3 * a_Decorators.size())));
+ Pkt.WriteByte(m_Scale);
+ Pkt.WriteVarInt(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());
}
+
+ Pkt.WriteByte(0);
}
@@ -774,21 +778,16 @@ void cProtocol180::SendMapDecorators(int a_ID, const cMapDecoratorList & a_Decor
void cProtocol180::SendMapInfo(int a_ID, unsigned int a_Scale)
{
- ASSERT(m_State == 3); // In game mode?
-
- cPacketizer Pkt(*this, 0x34);
- Pkt.WriteVarInt(a_ID);
- Pkt.WriteShort (2);
+ UNUSED(a_ID);
+ UNUSED(a_Scale);
- Pkt.WriteByte(2);
- Pkt.WriteByte(a_Scale);
+ // This packet was removed in 1.8
}
-
void cProtocol180::SendPickupSpawn(const cPickup & a_Pickup)
{
ASSERT(m_State == 3); // In game mode?