diff options
author | STRWarrior <niels.breuker@hotmail.nl> | 2013-12-15 10:51:46 +0100 |
---|---|---|
committer | STRWarrior <niels.breuker@hotmail.nl> | 2013-12-15 10:51:46 +0100 |
commit | c56af9a214fad89b5d6e119fa830cbdc6c6f5456 (patch) | |
tree | a352db7c045e11e45a4420897b3eebeda58f88a2 /src/Chunk.cpp | |
parent | Merge pull request #431 from mc-server/Entity_Effects (diff) | |
download | cuberite-c56af9a214fad89b5d6e119fa830cbdc6c6f5456.tar cuberite-c56af9a214fad89b5d6e119fa830cbdc6c6f5456.tar.gz cuberite-c56af9a214fad89b5d6e119fa830cbdc6c6f5456.tar.bz2 cuberite-c56af9a214fad89b5d6e119fa830cbdc6c6f5456.tar.lz cuberite-c56af9a214fad89b5d6e119fa830cbdc6c6f5456.tar.xz cuberite-c56af9a214fad89b5d6e119fa830cbdc6c6f5456.tar.zst cuberite-c56af9a214fad89b5d6e119fa830cbdc6c6f5456.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Chunk.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp index b3c1896dc..3eb46213c 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -2589,6 +2589,22 @@ void cChunk::BroadcastDestroyEntity(const cEntity & a_Entity, const cClientHandl +void cChunk::BroadcastEntityEffect(const cEntity & a_Entity, int a_EffectID, int a_Amplifier, short a_Duration, const cClientHandle * a_Exclude) +{ + for (cClientHandleList::const_iterator itr = m_LoadedByClient.begin(); itr != m_LoadedByClient.end(); ++itr ) + { + if (*itr == a_Exclude) + { + continue; + } + (*itr)->SendEntityEffect(a_Entity, a_EffectID, a_Amplifier, a_Duration); + } // for itr - LoadedByClient[] +} + + + + + void cChunk::BroadcastEntityEquipment(const cEntity & a_Entity, short a_SlotNum, const cItem & a_Item, const cClientHandle * a_Exclude) { for (cClientHandleList::const_iterator itr = m_LoadedByClient.begin(); itr != m_LoadedByClient.end(); ++itr ) @@ -2733,6 +2749,22 @@ void cChunk::BroadcastEntityAnimation(const cEntity & a_Entity, char a_Animation +void cChunk::BroadcastRemoveEntityEffect(const cEntity & a_Entity, int a_EffectID, const cClientHandle * a_Exclude) +{ + for (cClientHandleList::iterator itr = m_LoadedByClient.begin(); itr != m_LoadedByClient.end(); ++itr ) + { + if (*itr == a_Exclude) + { + continue; + } + (*itr)->SendRemoveEntityEffect(a_Entity, a_EffectID); + } // for itr - LoadedByClient[] +} + + + + + void cChunk::BroadcastSoundEffect(const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch, const cClientHandle * a_Exclude) { for (cClientHandleList::iterator itr = m_LoadedByClient.begin(); itr != m_LoadedByClient.end(); ++itr ) |