summaryrefslogtreecommitdiffstats
path: root/src/Protocol
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-09-12 20:57:44 +0200
committerGitHub <noreply@github.com>2020-09-12 20:57:44 +0200
commit93adbdce9a769b42baeb70f9ead5c7c6a35834b5 (patch)
treee0116770113a78af0d2d1c4d44a3878f551f0703 /src/Protocol
parentfixed missing include for FreeBSD. (#4852) (diff)
downloadcuberite-93adbdce9a769b42baeb70f9ead5c7c6a35834b5.tar
cuberite-93adbdce9a769b42baeb70f9ead5c7c6a35834b5.tar.gz
cuberite-93adbdce9a769b42baeb70f9ead5c7c6a35834b5.tar.bz2
cuberite-93adbdce9a769b42baeb70f9ead5c7c6a35834b5.tar.lz
cuberite-93adbdce9a769b42baeb70f9ead5c7c6a35834b5.tar.xz
cuberite-93adbdce9a769b42baeb70f9ead5c7c6a35834b5.tar.zst
cuberite-93adbdce9a769b42baeb70f9ead5c7c6a35834b5.zip
Diffstat (limited to '')
-rw-r--r--src/Protocol/Protocol.h2
-rw-r--r--src/Protocol/Protocol_1_8.cpp24
-rw-r--r--src/Protocol/Protocol_1_8.h2
3 files changed, 11 insertions, 17 deletions
diff --git a/src/Protocol/Protocol.h b/src/Protocol/Protocol.h
index 2456ac976..222e6031e 100644
--- a/src/Protocol/Protocol.h
+++ b/src/Protocol/Protocol.h
@@ -374,7 +374,7 @@ public:
virtual void SendEntityProperties (const cEntity & a_Entity) = 0;
virtual void SendEntityStatus (const cEntity & a_Entity, char a_Status) = 0;
virtual void SendEntityVelocity (const cEntity & a_Entity) = 0;
- virtual void SendExplosion (double a_BlockX, double a_BlockY, double a_BlockZ, float a_Radius, const cVector3iArray & a_BlocksAffected, const Vector3d & a_PlayerMotion) = 0;
+ virtual void SendExplosion (Vector3f a_Position, float a_Power) = 0;
virtual void SendGameMode (eGameMode a_GameMode) = 0;
virtual void SendHealth (void) = 0;
virtual void SendHeldItemChange (int a_ItemIndex) = 0;
diff --git a/src/Protocol/Protocol_1_8.cpp b/src/Protocol/Protocol_1_8.cpp
index 39c20b6cf..e5ba82111 100644
--- a/src/Protocol/Protocol_1_8.cpp
+++ b/src/Protocol/Protocol_1_8.cpp
@@ -620,25 +620,19 @@ void cProtocol_1_8_0::SendExperienceOrb(const cExpOrb & a_ExpOrb)
-void cProtocol_1_8_0::SendExplosion(double a_BlockX, double a_BlockY, double a_BlockZ, float a_Radius, const cVector3iArray & a_BlocksAffected, const Vector3d & a_PlayerMotion)
+void cProtocol_1_8_0::SendExplosion(const Vector3f a_Position, const float a_Power)
{
ASSERT(m_State == 3); // In game mode?
cPacketizer Pkt(*this, pktExplosion);
- Pkt.WriteBEFloat(static_cast<float>(a_BlockX));
- Pkt.WriteBEFloat(static_cast<float>(a_BlockY));
- Pkt.WriteBEFloat(static_cast<float>(a_BlockZ));
- Pkt.WriteBEFloat(static_cast<float>(a_Radius));
- Pkt.WriteBEUInt32(static_cast<UInt32>(a_BlocksAffected.size()));
- for (cVector3iArray::const_iterator itr = a_BlocksAffected.begin(), end = a_BlocksAffected.end(); itr != end; ++itr)
- {
- Pkt.WriteBEInt8(static_cast<Int8>(itr->x));
- Pkt.WriteBEInt8(static_cast<Int8>(itr->y));
- Pkt.WriteBEInt8(static_cast<Int8>(itr->z));
- } // for itr - a_BlockAffected[]
- Pkt.WriteBEFloat(static_cast<float>(a_PlayerMotion.x));
- Pkt.WriteBEFloat(static_cast<float>(a_PlayerMotion.y));
- Pkt.WriteBEFloat(static_cast<float>(a_PlayerMotion.z));
+ Pkt.WriteBEFloat(a_Position.x);
+ Pkt.WriteBEFloat(a_Position.y);
+ Pkt.WriteBEFloat(a_Position.z);
+ Pkt.WriteBEFloat(a_Power);
+ Pkt.WriteBEUInt32(0);
+ Pkt.WriteBEFloat(0);
+ Pkt.WriteBEFloat(0);
+ Pkt.WriteBEFloat(0);
}
diff --git a/src/Protocol/Protocol_1_8.h b/src/Protocol/Protocol_1_8.h
index f48ed4f9c..120676dd8 100644
--- a/src/Protocol/Protocol_1_8.h
+++ b/src/Protocol/Protocol_1_8.h
@@ -64,7 +64,7 @@ public:
virtual void SendEntityVelocity (const cEntity & a_Entity) override;
virtual void SendExperience (void) override;
virtual void SendExperienceOrb (const cExpOrb & a_ExpOrb) override;
- virtual void SendExplosion (double a_BlockX, double a_BlockY, double a_BlockZ, float a_Radius, const cVector3iArray & a_BlocksAffected, const Vector3d & a_PlayerMotion) override;
+ virtual void SendExplosion (Vector3f a_Position, float a_Power) override;
virtual void SendGameMode (eGameMode a_GameMode) override;
virtual void SendHealth (void) override;
virtual void SendHeldItemChange (int a_ItemIndex) override;