summaryrefslogtreecommitdiffstats
path: root/source/Chunk.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/Chunk.cpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/source/Chunk.cpp b/source/Chunk.cpp
index 7f1c94a07..d10aa6dac 100644
--- a/source/Chunk.cpp
+++ b/source/Chunk.cpp
@@ -16,6 +16,7 @@
#include "FurnaceEntity.h"
#include "SignEntity.h"
#include "NoteEntity.h"
+#include "JukeboxEntity.h"
#include "Torch.h"
#include "Ladder.h"
#include "Pickup.h"
@@ -809,6 +810,15 @@ void cChunk::CreateBlockEntities(void)
}
break;
}
+
+ case E_BLOCK_JUKEBOX:
+ {
+ if (!HasBlockEntityAt(x + m_PosX * Width, y + m_PosY * Height, z + m_PosZ * Width))
+ {
+ m_BlockEntities.push_back(new cJukeboxEntity(x + m_PosX * Width, y + m_PosY * Height, z + m_PosZ * Width, m_World) );
+ }
+ break;
+ }
} // switch (BlockType)
} // for y
} // for z
@@ -934,6 +944,11 @@ void cChunk::SetBlock( int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType
AddBlockEntity(new cNoteEntity(WorldPos.x, WorldPos.y, WorldPos.z, m_World));
break;
}
+ case E_BLOCK_JUKEBOX:
+ {
+ AddBlockEntity(new cJukeboxEntity(WorldPos.x, WorldPos.y, WorldPos.z, m_World));
+ break;
+ }
} // switch (a_BlockType)
}
@@ -1757,6 +1772,22 @@ void cChunk::BroadcastSoundEffect(const AString & a_SoundName, int a_SrcX, int a
+void cChunk::BroadcastSoundParticleEffect(int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data, const cClientHandle * a_Exclude)
+{
+ for (cClientHandleList::iterator itr = m_LoadedByClient.begin(); itr != m_LoadedByClient.end(); ++itr )
+ {
+ if (*itr == a_Exclude)
+ {
+ continue;
+ }
+ (*itr)->SendSoundParticleEffect(a_EffectID, a_SrcX, a_SrcY, a_SrcZ, a_Data);
+ } // for itr - LoadedByClient[]
+}
+
+
+
+
+
void cChunk::BroadcastBlockBreakAnimation(int a_entityID, int a_blockX, int a_blockY, int a_blockZ, char a_stage, const cClientHandle * a_Exclude)
{
for (cClientHandleList::iterator itr = m_LoadedByClient.begin(); itr != m_LoadedByClient.end(); ++itr )