summaryrefslogtreecommitdiffstats
path: root/src/Protocol
diff options
context:
space:
mode:
authorDave Tucker <dave@dtucker.co.uk>2015-11-24 00:39:19 +0100
committerDave Tucker <dave@dtucker.co.uk>2015-11-24 14:21:40 +0100
commit83870f9fc0e19da646f408a2d6636adfe4b5c002 (patch)
treed63858a16962f83d68620bc55c8efeed126874a6 /src/Protocol
parentMerge pull request #2645 from Gargaj/followedarray (diff)
downloadcuberite-83870f9fc0e19da646f408a2d6636adfe4b5c002.tar
cuberite-83870f9fc0e19da646f408a2d6636adfe4b5c002.tar.gz
cuberite-83870f9fc0e19da646f408a2d6636adfe4b5c002.tar.bz2
cuberite-83870f9fc0e19da646f408a2d6636adfe4b5c002.tar.lz
cuberite-83870f9fc0e19da646f408a2d6636adfe4b5c002.tar.xz
cuberite-83870f9fc0e19da646f408a2d6636adfe4b5c002.tar.zst
cuberite-83870f9fc0e19da646f408a2d6636adfe4b5c002.zip
Diffstat (limited to 'src/Protocol')
-rw-r--r--src/Protocol/Protocol.h3
-rw-r--r--src/Protocol/Protocol17x.cpp4
-rw-r--r--src/Protocol/Protocol17x.h2
-rw-r--r--src/Protocol/Protocol18x.cpp5
-rw-r--r--src/Protocol/Protocol18x.h2
-rw-r--r--src/Protocol/ProtocolRecognizer.cpp2
-rw-r--r--src/Protocol/ProtocolRecognizer.h2
7 files changed, 11 insertions, 9 deletions
diff --git a/src/Protocol/Protocol.h b/src/Protocol/Protocol.h
index 4581da6a9..af0485a78 100644
--- a/src/Protocol/Protocol.h
+++ b/src/Protocol/Protocol.h
@@ -15,6 +15,7 @@
#include "../Scoreboard.h"
#include "../Map.h"
#include "../ByteBuffer.h"
+#include "../EffectID.h"
#include <array>
@@ -123,7 +124,7 @@ public:
virtual void SendSetTitle (const cCompositeChat & a_Title) = 0;
virtual void SendSetRawTitle (const AString & a_Title) = 0;
virtual void SendSoundEffect (const AString & a_SoundName, double a_X, double a_Y, double a_Z, float a_Volume, float a_Pitch) = 0;
- virtual void SendSoundParticleEffect (int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data) = 0;
+ virtual void SendSoundParticleEffect (const EffectID a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data) = 0;
virtual void SendSpawnFallingBlock (const cFallingBlock & a_FallingBlock) = 0;
virtual void SendSpawnMob (const cMonster & a_Mob) = 0;
virtual void SendSpawnObject (const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, Byte a_Yaw, Byte a_Pitch) = 0;
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp
index 08ff4b268..010e1a8ba 100644
--- a/src/Protocol/Protocol17x.cpp
+++ b/src/Protocol/Protocol17x.cpp
@@ -1163,13 +1163,13 @@ void cProtocol172::SendSoundEffect(const AString & a_SoundName, double a_X, doub
-void cProtocol172::SendSoundParticleEffect(int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data)
+void cProtocol172::SendSoundParticleEffect(const EffectID a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data)
{
ASSERT(m_State == 3); // In game mode?
ASSERT((a_SrcY >= 0) && (a_SrcY < 256));
cPacketizer Pkt(*this, 0x28); // Effect packet
- Pkt.WriteBEInt32(a_EffectID);
+ Pkt.WriteBEInt32(static_cast<int>(a_EffectID));
Pkt.WriteBEInt32(a_SrcX);
Pkt.WriteBEUInt8(static_cast<Byte>(a_SrcY));
Pkt.WriteBEInt32(a_SrcZ);
diff --git a/src/Protocol/Protocol17x.h b/src/Protocol/Protocol17x.h
index cc201f840..747ffe186 100644
--- a/src/Protocol/Protocol17x.h
+++ b/src/Protocol/Protocol17x.h
@@ -121,7 +121,7 @@ public:
virtual void SendSetTitle (const cCompositeChat & a_Title) override;
virtual void SendSetRawTitle (const AString & a_Title) override;
virtual void SendSoundEffect (const AString & a_SoundName, double a_X, double a_Y, double a_Z, 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 SendSoundParticleEffect (const EffectID 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;
virtual void SendSpawnObject (const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, Byte a_Yaw, Byte a_Pitch) override;
diff --git a/src/Protocol/Protocol18x.cpp b/src/Protocol/Protocol18x.cpp
index 15dd085be..17b4dc6fd 100644
--- a/src/Protocol/Protocol18x.cpp
+++ b/src/Protocol/Protocol18x.cpp
@@ -19,6 +19,7 @@ Implements the 1.8.x protocol classes:
#include "../Root.h"
#include "../Server.h"
#include "../World.h"
+#include "../EffectID.h"
#include "../StringCompression.h"
#include "../CompositeChat.h"
#include "../Statistics.h"
@@ -1234,12 +1235,12 @@ void cProtocol180::SendSoundEffect(const AString & a_SoundName, double a_X, doub
-void cProtocol180::SendSoundParticleEffect(int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data)
+void cProtocol180::SendSoundParticleEffect(const EffectID a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data)
{
ASSERT(m_State == 3); // In game mode?
cPacketizer Pkt(*this, 0x28); // Effect packet
- Pkt.WriteBEInt32(a_EffectID);
+ Pkt.WriteBEInt32(static_cast<int>(a_EffectID));
Pkt.WritePosition64(a_SrcX, a_SrcY, a_SrcZ);
Pkt.WriteBEInt32(a_Data);
Pkt.WriteBool(false);
diff --git a/src/Protocol/Protocol18x.h b/src/Protocol/Protocol18x.h
index aa73a4a6a..8b5b7ffa2 100644
--- a/src/Protocol/Protocol18x.h
+++ b/src/Protocol/Protocol18x.h
@@ -120,7 +120,7 @@ public:
virtual void SendSetRawSubTitle (const AString & a_SubTitle) override;
virtual void SendSetTitle (const cCompositeChat & a_Title) override;
virtual void SendSetRawTitle (const AString & a_Title) override;
- virtual void SendSoundParticleEffect (int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data) override;
+ virtual void SendSoundParticleEffect (const EffectID 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;
virtual void SendSpawnObject (const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, Byte a_Yaw, Byte a_Pitch) override;
diff --git a/src/Protocol/ProtocolRecognizer.cpp b/src/Protocol/ProtocolRecognizer.cpp
index 845e7b56d..c88bd8639 100644
--- a/src/Protocol/ProtocolRecognizer.cpp
+++ b/src/Protocol/ProtocolRecognizer.cpp
@@ -709,7 +709,7 @@ void cProtocolRecognizer::SendSoundEffect(const AString & a_SoundName, double a_
-void cProtocolRecognizer::SendSoundParticleEffect(int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data)
+void cProtocolRecognizer::SendSoundParticleEffect(const EffectID a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data)
{
ASSERT(m_Protocol != nullptr);
m_Protocol->SendSoundParticleEffect(a_EffectID, a_SrcX, a_SrcY, a_SrcZ, a_Data);
diff --git a/src/Protocol/ProtocolRecognizer.h b/src/Protocol/ProtocolRecognizer.h
index 7b5952bea..c548ad5ba 100644
--- a/src/Protocol/ProtocolRecognizer.h
+++ b/src/Protocol/ProtocolRecognizer.h
@@ -108,7 +108,7 @@ public:
virtual void SendSetTitle (const cCompositeChat & a_Title) override;
virtual void SendSetRawTitle (const AString & a_Title) override;
virtual void SendSoundEffect (const AString & a_SoundName, double a_X, double a_Y, double a_Z, 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 SendSoundParticleEffect (const EffectID 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;
virtual void SendSpawnObject (const cEntity & a_Entity, char a_ObjectType, int a_ObjectData, Byte a_Yaw, Byte a_Pitch) override;