summaryrefslogtreecommitdiffstats
path: root/source/Protocol/Protocol125.cpp
diff options
context:
space:
mode:
authorkeyboard.osh@gmail.com <keyboard.osh@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-03-18 03:51:55 +0100
committerkeyboard.osh@gmail.com <keyboard.osh@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-03-18 03:51:55 +0100
commit8557ed83593444b3bfbf9dabb1a6ebbaa10299d3 (patch)
treec560c8243d5c93251ac308253e9d5870ee0f70e1 /source/Protocol/Protocol125.cpp
parentRewritten generators so that they use the cChunkDesc class (and thus can use cBlockArea merging) (diff)
downloadcuberite-8557ed83593444b3bfbf9dabb1a6ebbaa10299d3.tar
cuberite-8557ed83593444b3bfbf9dabb1a6ebbaa10299d3.tar.gz
cuberite-8557ed83593444b3bfbf9dabb1a6ebbaa10299d3.tar.bz2
cuberite-8557ed83593444b3bfbf9dabb1a6ebbaa10299d3.tar.lz
cuberite-8557ed83593444b3bfbf9dabb1a6ebbaa10299d3.tar.xz
cuberite-8557ed83593444b3bfbf9dabb1a6ebbaa10299d3.tar.zst
cuberite-8557ed83593444b3bfbf9dabb1a6ebbaa10299d3.zip
Diffstat (limited to '')
-rw-r--r--source/Protocol/Protocol125.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/source/Protocol/Protocol125.cpp b/source/Protocol/Protocol125.cpp
index 9514fb278..d2f3add7f 100644
--- a/source/Protocol/Protocol125.cpp
+++ b/source/Protocol/Protocol125.cpp
@@ -55,6 +55,7 @@ enum
PACKET_COLLECT_PICKUP = 0x16,
PACKET_SPAWN_OBJECT = 0x17,
PACKET_SPAWN_MOB = 0x18,
+ PACKET_ENTITY_VELOCITY = 0x1c,
PACKET_DESTROY_ENTITY = 0x1d,
PACKET_ENTITY = 0x1e,
PACKET_ENT_REL_MOVE = 0x1f,
@@ -276,6 +277,21 @@ void cProtocol125::SendDisconnect(const AString & a_Reason)
+void cProtocol125::SendEntVelocity(const cEntity & a_Entity)
+{
+ ASSERT(a_Entity.GetUniqueID() != m_Client->GetPlayer()->GetUniqueID()); // Must not send for self
+
+ cCSLock Lock(m_CSPacket);
+ WriteByte(PACKET_ENTITY_VELOCITY);
+ WriteInt (a_Entity.GetUniqueID());
+ WriteShort((short) (a_Entity.GetSpeedX() * 400)); //400 = 8000 / 20
+ WriteShort((short) (a_Entity.GetSpeedY() * 400));
+ WriteShort((short) (a_Entity.GetSpeedZ() * 400));
+ Flush();
+}
+
+
+
void cProtocol125::SendEntHeadLook(const cEntity & a_Entity)
{