diff options
author | Julian Laubstein <julianlaubstein@yahoo.de> | 2015-11-24 15:43:05 +0100 |
---|---|---|
committer | Julian Laubstein <julianlaubstein@yahoo.de> | 2015-11-24 15:43:05 +0100 |
commit | 412e5155a24339aa2a86f36e0ae5a9c5a0ff758d (patch) | |
tree | d63858a16962f83d68620bc55c8efeed126874a6 /src/BlockEntities | |
parent | Merge pull request #2645 from Gargaj/followedarray (diff) | |
parent | Add enum for Sound and Particle Effects (diff) | |
download | cuberite-412e5155a24339aa2a86f36e0ae5a9c5a0ff758d.tar cuberite-412e5155a24339aa2a86f36e0ae5a9c5a0ff758d.tar.gz cuberite-412e5155a24339aa2a86f36e0ae5a9c5a0ff758d.tar.bz2 cuberite-412e5155a24339aa2a86f36e0ae5a9c5a0ff758d.tar.lz cuberite-412e5155a24339aa2a86f36e0ae5a9c5a0ff758d.tar.xz cuberite-412e5155a24339aa2a86f36e0ae5a9c5a0ff758d.tar.zst cuberite-412e5155a24339aa2a86f36e0ae5a9c5a0ff758d.zip |
Diffstat (limited to 'src/BlockEntities')
-rw-r--r-- | src/BlockEntities/DropSpenserEntity.cpp | 15 | ||||
-rw-r--r-- | src/BlockEntities/JukeboxEntity.cpp | 5 | ||||
-rw-r--r-- | src/BlockEntities/MobSpawnerEntity.cpp | 2 |
3 files changed, 12 insertions, 10 deletions
diff --git a/src/BlockEntities/DropSpenserEntity.cpp b/src/BlockEntities/DropSpenserEntity.cpp index 3a93e85a1..211bf8662 100644 --- a/src/BlockEntities/DropSpenserEntity.cpp +++ b/src/BlockEntities/DropSpenserEntity.cpp @@ -6,6 +6,7 @@ #include "Globals.h" #include "DropSpenserEntity.h" +#include "../EffectID.h" #include "../Entities/Player.h" #include "../Chunk.h" #include "../UI/DropSpenserWindow.h" @@ -89,14 +90,14 @@ void cDropSpenserEntity::DropSpense(cChunk & a_Chunk) int SmokeDir = 0; switch (Meta) { - case E_META_DROPSPENSER_FACING_YP: SmokeDir = 4; break; // YP & YM don't have associated smoke dirs, just do 4 (centre of block) - case E_META_DROPSPENSER_FACING_YM: SmokeDir = 4; break; - case E_META_DROPSPENSER_FACING_XM: SmokeDir = 3; break; - case E_META_DROPSPENSER_FACING_XP: SmokeDir = 5; break; - case E_META_DROPSPENSER_FACING_ZM: SmokeDir = 1; break; - case E_META_DROPSPENSER_FACING_ZP: SmokeDir = 7; break; + case E_META_DROPSPENSER_FACING_YP: SmokeDir = static_cast<int>(SmokeDirection::CENTRE); break; // YP & YM don't have associated smoke dirs, just do 4 (centre of block) + case E_META_DROPSPENSER_FACING_YM: SmokeDir = static_cast<int>(SmokeDirection::CENTRE); break; + case E_META_DROPSPENSER_FACING_XM: SmokeDir = static_cast<int>(SmokeDirection::EAST); break; + case E_META_DROPSPENSER_FACING_XP: SmokeDir = static_cast<int>(SmokeDirection::WEST); break; + case E_META_DROPSPENSER_FACING_ZM: SmokeDir = static_cast<int>(SmokeDirection::SOUTH); break; + case E_META_DROPSPENSER_FACING_ZP: SmokeDir = static_cast<int>(SmokeDirection::NORTH); break; } - m_World->BroadcastSoundParticleEffect(2000, m_PosX, m_PosY, m_PosZ, SmokeDir); + m_World->BroadcastSoundParticleEffect(EffectID::PARTICLE_SMOKE, m_PosX, m_PosY, m_PosZ, SmokeDir); m_World->BroadcastSoundEffect("random.click", static_cast<double>(m_PosX), static_cast<double>(m_PosY), static_cast<double>(m_PosZ), 1.0f, 1.0f); } diff --git a/src/BlockEntities/JukeboxEntity.cpp b/src/BlockEntities/JukeboxEntity.cpp index 3a2d9f37c..1f3f4f324 100644 --- a/src/BlockEntities/JukeboxEntity.cpp +++ b/src/BlockEntities/JukeboxEntity.cpp @@ -3,6 +3,7 @@ #include "JukeboxEntity.h" #include "../World.h" +#include "../EffectID.h" #include "json/value.h" #include "Entities/Player.h" @@ -60,7 +61,7 @@ bool cJukeboxEntity::PlayRecord(int a_Record) EjectRecord(); } m_Record = a_Record; - m_World->BroadcastSoundParticleEffect(1005, m_PosX, m_PosY, m_PosZ, m_Record); + m_World->BroadcastSoundParticleEffect(EffectID::SFX_PLAY_MUSIC_DISC, m_PosX, m_PosY, m_PosZ, m_Record); m_World->SetBlockMeta(m_PosX, m_PosY, m_PosZ, E_META_JUKEBOX_ON); return true; } @@ -81,7 +82,7 @@ bool cJukeboxEntity::EjectRecord(void) Drops.push_back(cItem(static_cast<short>(m_Record), 1, 0)); m_Record = 0; m_World->SpawnItemPickups(Drops, m_PosX + 0.5, m_PosY + 1, m_PosZ + 0.5, 8); - m_World->BroadcastSoundParticleEffect(1005, m_PosX, m_PosY, m_PosZ, 0); + m_World->BroadcastSoundParticleEffect(EffectID::SFX_PLAY_MUSIC_DISC, m_PosX, m_PosY, m_PosZ, 0); m_World->SetBlockMeta(m_PosX, m_PosY, m_PosZ, E_META_JUKEBOX_OFF); return true; } diff --git a/src/BlockEntities/MobSpawnerEntity.cpp b/src/BlockEntities/MobSpawnerEntity.cpp index 1a0ce5b22..4418dca15 100644 --- a/src/BlockEntities/MobSpawnerEntity.cpp +++ b/src/BlockEntities/MobSpawnerEntity.cpp @@ -173,7 +173,7 @@ void cMobSpawnerEntity::SpawnEntity(void) { EntitiesSpawned = true; Chunk->BroadcastSoundParticleEffect( - 2004, + EffectID::PARTICLE_MOBSPAWN, static_cast<int>(PosX * 8.0), static_cast<int>(RelY * 8.0), static_cast<int>(PosZ * 8.0), |