From 01e4d0bd051b30d5f82a60c16ae98c89ff69bc4d Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Thu, 27 Dec 2012 07:15:26 +0000 Subject: [PATCH] Fixed 1.4.6 falling blocks. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1109 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Protocol/Protocol14x.cpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/source/Protocol/Protocol14x.cpp b/source/Protocol/Protocol14x.cpp index d9be4948c..1cb4c922d 100644 --- a/source/Protocol/Protocol14x.cpp +++ b/source/Protocol/Protocol14x.cpp @@ -188,7 +188,7 @@ void cProtocol146::SendPickupSpawn(const cPickup & a_Pickup) void cProtocol146::SendSpawnFallingBlock(const cFallingBlock & a_FallingBlock) { - // Send two packets - spawn object, then entity metadata + // Send a spawn object / vehicle packet cCSLock Lock(m_CSPacket); WriteByte(PACKET_SPAWN_OBJECT); @@ -197,20 +197,12 @@ void cProtocol146::SendSpawnFallingBlock(const cFallingBlock & a_FallingBlock) WriteInt ((int)(a_FallingBlock.GetPosX() * 32)); WriteInt ((int)(a_FallingBlock.GetPosY() * 32)); WriteInt ((int)(a_FallingBlock.GetPosZ() * 32)); - WriteInt (0x800000); - WriteShort(0); - WriteShort(0); - WriteShort(0); - WriteByte (0); - WriteByte (0); - - // TODO: This still doesn't work, although it is exactly the same that the vanilla server sends. WTF? - WriteByte(PACKET_ENTITY_METADATA); - WriteInt(a_FallingBlock.GetUniqueID()); - WriteByte(0xaa); // a slot value at index 10 - cItem Item(a_FallingBlock.GetBlockType(), 1); - WriteItem(Item); - WriteByte(0x7f); // End of metadata + WriteByte (0); // Yaw + WriteByte (0); // Pitch + WriteInt (a_FallingBlock.GetBlockType()); // data indicator = blocktype + WriteShort(0); // SpeedX + WriteShort(0); // SpeedY + WriteShort(0); // SpeedZ Flush(); }