summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSTRWarrior <niels.breuker@hotmail.nl>2013-11-25 20:04:39 +0100
committerSTRWarrior <niels.breuker@hotmail.nl>2013-11-25 20:04:39 +0100
commitf86f67907cf3812c09ad10166677e9c91b1f1198 (patch)
tree87f60845f256541c495b9f3aa4d84c23a3857868
parentImplented Spawn Experience Orb packet. (diff)
downloadcuberite-f86f67907cf3812c09ad10166677e9c91b1f1198.tar
cuberite-f86f67907cf3812c09ad10166677e9c91b1f1198.tar.gz
cuberite-f86f67907cf3812c09ad10166677e9c91b1f1198.tar.bz2
cuberite-f86f67907cf3812c09ad10166677e9c91b1f1198.tar.lz
cuberite-f86f67907cf3812c09ad10166677e9c91b1f1198.tar.xz
cuberite-f86f67907cf3812c09ad10166677e9c91b1f1198.tar.zst
cuberite-f86f67907cf3812c09ad10166677e9c91b1f1198.zip
Diffstat (limited to '')
-rw-r--r--source/ClientHandle.cpp9
-rw-r--r--source/ClientHandle.h1
-rw-r--r--source/Entities/Entity.h1
-rw-r--r--source/Mobs/Monster.cpp4
4 files changed, 15 insertions, 0 deletions
diff --git a/source/ClientHandle.cpp b/source/ClientHandle.cpp
index daf09d4ea..1bc741aa6 100644
--- a/source/ClientHandle.cpp
+++ b/source/ClientHandle.cpp
@@ -1885,6 +1885,15 @@ void cClientHandle::SendExperience(void)
+void cClientHandle::SendExperienceOrb(const cEntity & a_Entity)
+{
+ m_Protocol->SendExperienceOrb(a_Entity);
+}
+
+
+
+
+
void cClientHandle::SendSoundEffect(const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch)
{
m_Protocol->SendSoundEffect(a_SoundName, a_SrcX, a_SrcY, a_SrcZ, a_Volume, a_Pitch);
diff --git a/source/ClientHandle.h b/source/ClientHandle.h
index b887bb11a..2857b0dcd 100644
--- a/source/ClientHandle.h
+++ b/source/ClientHandle.h
@@ -121,6 +121,7 @@ public:
void SendPlayerSpawn (const cPlayer & a_Player);
void SendRespawn (void);
void SendExperience (void);
+ void SendExperienceOrb (const cEntity & a_Entity);
void SendSoundEffect (const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch); // a_Src coords are Block * 8
void SendSoundParticleEffect (int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data);
void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock);
diff --git a/source/Entities/Entity.h b/source/Entities/Entity.h
index dafda7826..de5f176ae 100644
--- a/source/Entities/Entity.h
+++ b/source/Entities/Entity.h
@@ -74,6 +74,7 @@ public:
etBoat,
etTNT,
etProjectile,
+ etExpOrb,
// Common variations
etMob = etMonster, // DEPRECATED, use etMonster instead!
diff --git a/source/Mobs/Monster.cpp b/source/Mobs/Monster.cpp
index 8a5717e27..f250e1757 100644
--- a/source/Mobs/Monster.cpp
+++ b/source/Mobs/Monster.cpp
@@ -7,6 +7,7 @@
#include "../ClientHandle.h"
#include "../World.h"
#include "../Entities/Player.h"
+#include "../Entities/ExpOrb.h"
#include "../Defines.h"
#include "../MonsterConfig.h"
#include "../MersenneTwister.h"
@@ -258,6 +259,9 @@ void cMonster::KilledBy(cEntity * a_Killer)
{
m_World->BroadcastSoundEffect(m_SoundDeath, (int)(GetPosX() * 8), (int)(GetPosY() * 8), (int)(GetPosZ() * 8), 1.0f, 0.8f);
}
+ // ToDo: Proper Exp per mob.
+ cExpOrb * ExpOrb = new cExpOrb(GetPosX(), GetPosY(), GetPosZ(), 1);
+ ExpOrb->Initialize(m_World);
m_DestroyTimer = 0;
}