summaryrefslogtreecommitdiffstats
path: root/source/Chunk.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-10-21 09:46:28 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-10-21 09:46:28 +0200
commit3f9e876d70851ed0333a3fdc57d883f040e92d8b (patch)
tree789155746561aed3b04818ed4221f40fa42e77fd /source/Chunk.cpp
parentDouble chests are now working, and with sound. (FS #69) (diff)
downloadcuberite-3f9e876d70851ed0333a3fdc57d883f040e92d8b.tar
cuberite-3f9e876d70851ed0333a3fdc57d883f040e92d8b.tar.gz
cuberite-3f9e876d70851ed0333a3fdc57d883f040e92d8b.tar.bz2
cuberite-3f9e876d70851ed0333a3fdc57d883f040e92d8b.tar.lz
cuberite-3f9e876d70851ed0333a3fdc57d883f040e92d8b.tar.xz
cuberite-3f9e876d70851ed0333a3fdc57d883f040e92d8b.tar.zst
cuberite-3f9e876d70851ed0333a3fdc57d883f040e92d8b.zip
Diffstat (limited to 'source/Chunk.cpp')
-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 )