summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-09-12 18:12:42 +0200
committerHowaner <franzi.moos@googlemail.com>2014-09-12 18:12:42 +0200
commit010ac1e5f7ae606c798fb280562700d1a0c8d978 (patch)
tree3032c7d908b2fadbdba91a0f9cd7ebae70f1e8c7 /src/ClientHandle.cpp
parentSpawn exp if you break a mob spawner. (diff)
downloadcuberite-010ac1e5f7ae606c798fb280562700d1a0c8d978.tar
cuberite-010ac1e5f7ae606c798fb280562700d1a0c8d978.tar.gz
cuberite-010ac1e5f7ae606c798fb280562700d1a0c8d978.tar.bz2
cuberite-010ac1e5f7ae606c798fb280562700d1a0c8d978.tar.lz
cuberite-010ac1e5f7ae606c798fb280562700d1a0c8d978.tar.xz
cuberite-010ac1e5f7ae606c798fb280562700d1a0c8d978.tar.zst
cuberite-010ac1e5f7ae606c798fb280562700d1a0c8d978.zip
Diffstat (limited to '')
-rw-r--r--src/ClientHandle.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index e2759dc6c..02c2f4c56 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -1453,8 +1453,20 @@ void cClientHandle::HandlePlaceBlock(int a_BlockX, int a_BlockY, int a_BlockZ, e
cChunkInterface ChunkInterface(World->GetChunkMap());
NewBlock->OnPlacedByPlayer(ChunkInterface, *World, m_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ, BlockType, BlockMeta);
- // Step sound with 0.8f pitch is used as block placement sound
- World->BroadcastSoundEffect(cBlockInfo::GetPlaceSound(BlockType), (double)a_BlockX, (double)a_BlockY, (double)a_BlockZ, 1.0f, 0.8f);
+ AString PlaceSound = cBlockInfo::GetPlaceSound(BlockType);
+ float Volume = 1.0f, Pitch = 0.8f;
+ if (PlaceSound == "dig.metal")
+ {
+ Pitch = 1.2f;
+ PlaceSound = "dig.stone";
+ }
+ else if (PlaceSound == "random.anvil_land")
+ {
+ Volume = 0.65f;
+ }
+
+ World->BroadcastSoundEffect(PlaceSound, (double)a_BlockX, (double)a_BlockY, (double)a_BlockZ, Volume, Pitch);
+
cRoot::Get()->GetPluginManager()->CallHookPlayerPlacedBlock(*m_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ, BlockType, BlockMeta);
}