summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/ClientHandle.cpp4
-rw-r--r--source/ClientHandle.h3
-rw-r--r--source/Entities/ExpOrb.cpp2
-rw-r--r--source/Entities/ExpOrb.h2
-rw-r--r--source/Mobs/Monster.cpp18
-rw-r--r--source/Protocol/Protocol.h3
-rw-r--r--source/Protocol/Protocol125.cpp12
-rw-r--r--source/Protocol/Protocol125.h2
-rw-r--r--source/Protocol/Protocol17x.cpp12
-rw-r--r--source/Protocol/Protocol17x.h2
-rw-r--r--source/Protocol/ProtocolRecognizer.cpp4
-rw-r--r--source/Protocol/ProtocolRecognizer.h2
12 files changed, 36 insertions, 30 deletions
diff --git a/source/ClientHandle.cpp b/source/ClientHandle.cpp
index 1bc741aa6..b3e12ce77 100644
--- a/source/ClientHandle.cpp
+++ b/source/ClientHandle.cpp
@@ -1885,9 +1885,9 @@ void cClientHandle::SendExperience(void)
-void cClientHandle::SendExperienceOrb(const cEntity & a_Entity)
+void cClientHandle::SendExperienceOrb(const cExpOrb & a_ExpOrb)
{
- m_Protocol->SendExperienceOrb(a_Entity);
+ m_Protocol->SendExperienceOrb(a_ExpOrb);
}
diff --git a/source/ClientHandle.h b/source/ClientHandle.h
index 2857b0dcd..b3550110d 100644
--- a/source/ClientHandle.h
+++ b/source/ClientHandle.h
@@ -25,6 +25,7 @@ class cChunkDataSerializer;
class cInventory;
class cMonster;
class cPawn;
+class cExpOrb;
class cPickup;
class cPlayer;
class cProtocol;
@@ -121,7 +122,7 @@ public:
void SendPlayerSpawn (const cPlayer & a_Player);
void SendRespawn (void);
void SendExperience (void);
- void SendExperienceOrb (const cEntity & a_Entity);
+ void SendExperienceOrb (const cExpOrb & a_ExpOrb);
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/ExpOrb.cpp b/source/Entities/ExpOrb.cpp
index 200f6e181..1e5ee00ce 100644
--- a/source/Entities/ExpOrb.cpp
+++ b/source/Entities/ExpOrb.cpp
@@ -40,7 +40,7 @@ void cExpOrb::SpawnOn(cClientHandle & a_Client)
void cExpOrb::Tick(float a_Dt, cChunk & a_Chunk)
{
- cPlayer * a_ClosestPlayer(m_World->FindClosestPlayer(Vector3f(GetPosition()), 3));
+ cPlayer * a_ClosestPlayer(m_World->FindClosestPlayer(Vector3f(GetPosition()), 4));
if (a_ClosestPlayer)
{
Vector3f a_PlayerPos(a_ClosestPlayer->GetPosition());
diff --git a/source/Entities/ExpOrb.h b/source/Entities/ExpOrb.h
index 0f1b6ede7..a062eedd3 100644
--- a/source/Entities/ExpOrb.h
+++ b/source/Entities/ExpOrb.h
@@ -22,7 +22,7 @@ public:
virtual void SpawnOn(cClientHandle & a_Client) override;
// cExpOrb functions
- short int GetReward(void) const { return m_Reward; }
+ int GetReward(void) const { return m_Reward; }
protected:
int m_Reward;
diff --git a/source/Mobs/Monster.cpp b/source/Mobs/Monster.cpp
index a74881978..091623c8a 100644
--- a/source/Mobs/Monster.cpp
+++ b/source/Mobs/Monster.cpp
@@ -259,7 +259,7 @@ void cMonster::KilledBy(cEntity * a_Killer)
{
m_World->BroadcastSoundEffect(m_SoundDeath, (int)(GetPosX() * 8), (int)(GetPosY() * 8), (int)(GetPosZ() * 8), 1.0f, 0.8f);
}
- int Exp;
+ int Reward;
switch (m_MobType)
{
// Animals
@@ -273,7 +273,7 @@ void cMonster::KilledBy(cEntity * a_Killer)
case cMonster::mtOcelot:
case cMonster::mtWolf:
{
- Exp = m_World->GetTickRandomNumber(2) + 1;
+ Reward = m_World->GetTickRandomNumber(2) + 1;
}
// Monsters
@@ -290,25 +290,29 @@ void cMonster::KilledBy(cEntity * a_Killer)
case cMonster::mtSlime:
case cMonster::mtMagmaCube:
{
- Exp = 6 + (m_World->GetTickRandomNumber(2));
+ Reward = 6 + (m_World->GetTickRandomNumber(2));
+ }
+ case cMonster::mtBlaze:
+ {
+ Reward = 10;
}
// Bosses
case cMonster::mtEnderDragon:
{
- Exp = 12000;
+ Reward = 12000;
}
case cMonster::mtWither:
{
- Exp = 50;
+ Reward = 50;
}
default:
{
- Exp = 0;
+ Reward = 0;
}
}
- m_World->SpawnExperienceOrb(GetPosX(), GetPosY(), GetPosZ(), Exp);
+ m_World->SpawnExperienceOrb(GetPosX(), GetPosY(), GetPosZ(), Reward);
m_DestroyTimer = 0;
}
diff --git a/source/Protocol/Protocol.h b/source/Protocol/Protocol.h
index 18cf3676a..9d8183361 100644
--- a/source/Protocol/Protocol.h
+++ b/source/Protocol/Protocol.h
@@ -16,6 +16,7 @@
+class cExpOrb;
class cPlayer;
class cEntity;
class cWindow;
@@ -86,7 +87,7 @@ public:
virtual void SendPlayerSpawn (const cPlayer & a_Player) = 0;
virtual void SendRespawn (void) = 0;
virtual void SendExperience (void) = 0;
- virtual void SendExperienceOrb (const cEntity & a_Entity) = 0;
+ virtual void SendExperienceOrb (const cExpOrb & a_ExpOrb) = 0;
virtual void SendSoundEffect (const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch) = 0; // a_Src coords are Block * 8
virtual void SendSoundParticleEffect (int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data) = 0;
virtual void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock) = 0;
diff --git a/source/Protocol/Protocol125.cpp b/source/Protocol/Protocol125.cpp
index 3b753479d..b1dd17ea1 100644
--- a/source/Protocol/Protocol125.cpp
+++ b/source/Protocol/Protocol125.cpp
@@ -707,15 +707,15 @@ void cProtocol125::SendExperience(void)
-void cProtocol125::SendExperienceOrb(const cEntity & a_Entity)
+void cProtocol125::SendExperienceOrb(const cExpOrb & a_ExpOrb)
{
cCSLock Lock(m_CSPacket);
WriteByte(PACKET_SPAWN_EXPERIENCE_ORB);
- WriteInt(a_Entity.GetUniqueID());
- WriteInt((int) a_Entity.GetPosX());
- WriteInt((int) a_Entity.GetPosY());
- WriteInt((int) a_Entity.GetPosZ());
- WriteShort(((cExpOrb &)a_Entity).GetReward());
+ WriteInt(a_ExpOrb.GetUniqueID());
+ WriteInt((int) a_ExpOrb.GetPosX());
+ WriteInt((int) a_ExpOrb.GetPosY());
+ WriteInt((int) a_ExpOrb.GetPosZ());
+ WriteShort(a_ExpOrb.GetReward());
Flush();
}
diff --git a/source/Protocol/Protocol125.h b/source/Protocol/Protocol125.h
index 2182ea356..5a9218f5b 100644
--- a/source/Protocol/Protocol125.h
+++ b/source/Protocol/Protocol125.h
@@ -63,7 +63,7 @@ public:
virtual void SendPlayerSpawn (const cPlayer & a_Player) override;
virtual void SendRespawn (void) override;
virtual void SendExperience (void) override;
- virtual void SendExperienceOrb (const cEntity & a_Entity) override;
+ virtual void SendExperienceOrb (const cExpOrb & a_ExpOrb) override;
virtual void SendSoundEffect (const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch) override; // a_Src coords are Block * 8
virtual void SendSoundParticleEffect (int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data) override;
virtual void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock) override;
diff --git a/source/Protocol/Protocol17x.cpp b/source/Protocol/Protocol17x.cpp
index cf5c84599..746e1c127 100644
--- a/source/Protocol/Protocol17x.cpp
+++ b/source/Protocol/Protocol17x.cpp
@@ -610,14 +610,14 @@ void cProtocol172::SendExperience (void)
-void cProtocol172::SendExperienceOrb(const cEntity & a_Entity)
+void cProtocol172::SendExperienceOrb(const cExpOrb & a_ExpOrb)
{
cPacketizer Pkt(*this, 0x11);
- Pkt.WriteVarInt(a_Entity.GetUniqueID());
- Pkt.WriteInt((int) a_Entity.GetPosX());
- Pkt.WriteInt((int) a_Entity.GetPosY());
- Pkt.WriteInt((int) a_Entity.GetPosZ());
- Pkt.WriteShort(((cExpOrb &)a_Entity).GetReward());
+ Pkt.WriteVarInt(a_ExpOrb.GetUniqueID());
+ Pkt.WriteInt((int) a_ExpOrb.GetPosX());
+ Pkt.WriteInt((int) a_ExpOrb.GetPosY());
+ Pkt.WriteInt((int) a_ExpOrb.GetPosZ());
+ Pkt.WriteShort(a_ExpOrb.GetReward());
}
diff --git a/source/Protocol/Protocol17x.h b/source/Protocol/Protocol17x.h
index 6b8d2ce79..255cb4ef5 100644
--- a/source/Protocol/Protocol17x.h
+++ b/source/Protocol/Protocol17x.h
@@ -73,7 +73,7 @@ public:
virtual void SendRespawn (void) override;
virtual void SendSoundEffect (const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch) override; // a_Src coords are Block * 8
virtual void SendExperience (void) override;
- virtual void SendExperienceOrb (const cEntity & a_Entity) override;
+ virtual void SendExperienceOrb (const cExpOrb & a_ExpOrb) override;
virtual void SendSoundParticleEffect (int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data) override;
virtual void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock) override;
virtual void SendSpawnMob (const cMonster & a_Mob) override;
diff --git a/source/Protocol/ProtocolRecognizer.cpp b/source/Protocol/ProtocolRecognizer.cpp
index ad00e8d38..489149d74 100644
--- a/source/Protocol/ProtocolRecognizer.cpp
+++ b/source/Protocol/ProtocolRecognizer.cpp
@@ -476,10 +476,10 @@ void cProtocolRecognizer::SendExperience(void)
-void cProtocolRecognizer::SendExperienceOrb(const cEntity & a_Entity)
+void cProtocolRecognizer::SendExperienceOrb(const cExpOrb & a_ExpOrb)
{
ASSERT(m_Protocol != NULL);
- m_Protocol->SendExperienceOrb(a_Entity);
+ m_Protocol->SendExperienceOrb(a_ExpOrb);
}
diff --git a/source/Protocol/ProtocolRecognizer.h b/source/Protocol/ProtocolRecognizer.h
index 62e624980..9ca0c1c88 100644
--- a/source/Protocol/ProtocolRecognizer.h
+++ b/source/Protocol/ProtocolRecognizer.h
@@ -98,7 +98,7 @@ public:
virtual void SendPlayerSpawn (const cPlayer & a_Player) override;
virtual void SendRespawn (void) override;
virtual void SendExperience (void) override;
- virtual void SendExperienceOrb (const cEntity & a_Entity) override;
+ virtual void SendExperienceOrb (const cExpOrb & a_ExpOrb) override;
virtual void SendSoundEffect (const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch) override;
virtual void SendSoundParticleEffect (int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data) override;
virtual void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock) override;