summaryrefslogtreecommitdiffstats
path: root/source/Protocol/Protocol132.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-10-03 20:44:42 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-10-03 20:44:42 +0200
commit5bbeeb3d6697c3b8ec5640aea07e594eaf3a22b0 (patch)
tree66abec621a03faf3dd57e28af53e7aeed7a6abb3 /source/Protocol/Protocol132.cpp
parentMinor style cleanup (diff)
downloadcuberite-5bbeeb3d6697c3b8ec5640aea07e594eaf3a22b0.tar
cuberite-5bbeeb3d6697c3b8ec5640aea07e594eaf3a22b0.tar.gz
cuberite-5bbeeb3d6697c3b8ec5640aea07e594eaf3a22b0.tar.bz2
cuberite-5bbeeb3d6697c3b8ec5640aea07e594eaf3a22b0.tar.lz
cuberite-5bbeeb3d6697c3b8ec5640aea07e594eaf3a22b0.tar.xz
cuberite-5bbeeb3d6697c3b8ec5640aea07e594eaf3a22b0.tar.zst
cuberite-5bbeeb3d6697c3b8ec5640aea07e594eaf3a22b0.zip
Diffstat (limited to 'source/Protocol/Protocol132.cpp')
-rw-r--r--source/Protocol/Protocol132.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/source/Protocol/Protocol132.cpp b/source/Protocol/Protocol132.cpp
index d8c9f1f27..f356b611a 100644
--- a/source/Protocol/Protocol132.cpp
+++ b/source/Protocol/Protocol132.cpp
@@ -14,6 +14,7 @@
#include "../Player.h"
#include "../Mobs/Monster.h"
#include "../UI/Window.h"
+#include "../Pickup.h"
@@ -56,6 +57,7 @@ enum
PACKET_ENTITY_EQUIPMENT = 0x05,
PACKET_COMPASS = 0x06,
PACKET_PLAYER_SPAWN = 0x14,
+ PACKET_COLLECT_PICKUP = 0x16,
PACKET_SPAWN_MOB = 0x18,
PACKET_DESTROY_ENTITIES = 0x1d,
PACKET_CHUNK_DATA = 0x33,
@@ -247,6 +249,26 @@ void cProtocol132::SendChunkData(int a_ChunkX, int a_ChunkZ, cChunkDataSerialize
+void cProtocol132::SendCollectPickup(const cPickup & a_Pickup, const cPlayer & a_Player)
+{
+ cCSLock Lock(m_CSPacket);
+ WriteByte(PACKET_COLLECT_PICKUP);
+ WriteInt (a_Pickup.GetUniqueID());
+ WriteInt (a_Player.GetUniqueID());
+ Flush();
+
+ // Also send the "pop" sound effect with a somewhat random pitch (fast-random using EntityID ;)
+ SendSoundEffect(
+ "random.pop",
+ (int)(a_Pickup.GetPosX() * 8), (int)(a_Pickup.GetPosY() * 8), (int)(a_Pickup.GetPosZ() * 8),
+ 0.5, (float)(0.75 + ((float)((a_Pickup.GetUniqueID() * 23) % 32)) / 64)
+ );
+}
+
+
+
+
+
void cProtocol132::SendDestroyEntity(const cEntity & a_Entity)
{
cCSLock Lock(m_CSPacket);