diff options
author | Mattes D <github@xoft.cz> | 2013-11-26 10:48:46 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2013-11-26 10:48:46 +0100 |
commit | 6041fa1e62cc490c4595e6cd267eb96ac5b6e041 (patch) | |
tree | 00e3c895d8e0143275ba6d1a9a1ff0361714b53e /source/Protocol/Protocol125.cpp | |
parent | Fixed cFile compilation on Linux. (diff) | |
parent | Added ExpOrb.cpp and ExpOrb.h to MCServer.vcproj. (diff) | |
download | cuberite-6041fa1e62cc490c4595e6cd267eb96ac5b6e041.tar cuberite-6041fa1e62cc490c4595e6cd267eb96ac5b6e041.tar.gz cuberite-6041fa1e62cc490c4595e6cd267eb96ac5b6e041.tar.bz2 cuberite-6041fa1e62cc490c4595e6cd267eb96ac5b6e041.tar.lz cuberite-6041fa1e62cc490c4595e6cd267eb96ac5b6e041.tar.xz cuberite-6041fa1e62cc490c4595e6cd267eb96ac5b6e041.tar.zst cuberite-6041fa1e62cc490c4595e6cd267eb96ac5b6e041.zip |
Diffstat (limited to 'source/Protocol/Protocol125.cpp')
-rw-r--r-- | source/Protocol/Protocol125.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/Protocol/Protocol125.cpp b/source/Protocol/Protocol125.cpp index 54be65b12..b1dd17ea1 100644 --- a/source/Protocol/Protocol125.cpp +++ b/source/Protocol/Protocol125.cpp @@ -17,6 +17,7 @@ Documentation: #include "../World.h" #include "ChunkDataSerializer.h" #include "../Entities/Entity.h" +#include "../Entities/ExpOrb.h" #include "../Mobs/Monster.h" #include "../Entities/Pickup.h" #include "../Entities/Player.h" @@ -72,6 +73,7 @@ enum PACKET_ENT_STATUS = 0x26, PACKET_ATTACH_ENTITY = 0x27, PACKET_METADATA = 0x28, + PACKET_SPAWN_EXPERIENCE_ORB = 0x1A, PACKET_EXPERIENCE = 0x2b, PACKET_PRE_CHUNK = 0x32, PACKET_MAP_CHUNK = 0x33, @@ -705,6 +707,22 @@ void cProtocol125::SendExperience(void) +void cProtocol125::SendExperienceOrb(const cExpOrb & a_ExpOrb) +{ + cCSLock Lock(m_CSPacket); + WriteByte(PACKET_SPAWN_EXPERIENCE_ORB); + WriteInt(a_ExpOrb.GetUniqueID()); + WriteInt((int) a_ExpOrb.GetPosX()); + WriteInt((int) a_ExpOrb.GetPosY()); + WriteInt((int) a_ExpOrb.GetPosZ()); + WriteShort(a_ExpOrb.GetReward()); + Flush(); +} + + + + + void cProtocol125::SendSoundEffect(const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch) { // Not needed in this protocol version |