summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJulian Laubstein <julianlaubstein@yahoo.de>2015-11-08 22:03:42 +0100
committerJulian Laubstein <julianlaubstein@yahoo.de>2015-11-08 22:03:42 +0100
commitfbd1eb2f443226eca4f1c53a4acf22046e307915 (patch)
tree3078a61628c4b1b022d687ed9b44dfd67232894e /src
parentMerge pull request #2624 from Gargaj/patch-2 (diff)
parentadd sound to stone pressure plates (diff)
downloadcuberite-fbd1eb2f443226eca4f1c53a4acf22046e307915.tar
cuberite-fbd1eb2f443226eca4f1c53a4acf22046e307915.tar.gz
cuberite-fbd1eb2f443226eca4f1c53a4acf22046e307915.tar.bz2
cuberite-fbd1eb2f443226eca4f1c53a4acf22046e307915.tar.lz
cuberite-fbd1eb2f443226eca4f1c53a4acf22046e307915.tar.xz
cuberite-fbd1eb2f443226eca4f1c53a4acf22046e307915.tar.zst
cuberite-fbd1eb2f443226eca4f1c53a4acf22046e307915.zip
Diffstat (limited to 'src')
-rw-r--r--src/Simulator/IncrementalRedstoneSimulator.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Simulator/IncrementalRedstoneSimulator.cpp b/src/Simulator/IncrementalRedstoneSimulator.cpp
index b13ba9303..43f38584e 100644
--- a/src/Simulator/IncrementalRedstoneSimulator.cpp
+++ b/src/Simulator/IncrementalRedstoneSimulator.cpp
@@ -1161,14 +1161,23 @@ void cIncrementalRedstoneSimulator::HandlePressurePlate(int a_RelBlockX, int a_R
// MCS feature - stone pressure plates can only be triggered by players :D
cPlayer * a_Player = this->m_World.FindClosestPlayer(Vector3f(BlockX + 0.5f, static_cast<float>(a_RelBlockY), BlockZ + 0.5f), 0.5f, false);
+ NIBBLETYPE Meta = m_Chunk->GetMeta(a_RelBlockX, a_RelBlockY, a_RelBlockZ);
if (a_Player != nullptr)
{
+ if (Meta == E_META_PRESSURE_PLATE_RAISED)
+ {
+ m_Chunk->BroadcastSoundEffect("random.click", static_cast<double>(BlockX) + 0.5, static_cast<double>(a_RelBlockY) + 0.1, static_cast<double>(BlockZ) + 0.5, 0.3F, 0.5F);
+ }
m_Chunk->SetMeta(a_RelBlockX, a_RelBlockY, a_RelBlockZ, 0x1);
SetAllDirsAsPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ);
SetDirectionLinkedPowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, BLOCK_FACE_YM);
}
else
{
+ if (Meta == E_META_PRESSURE_PLATE_DEPRESSED)
+ {
+ m_Chunk->BroadcastSoundEffect("random.click", static_cast<double>(BlockX) + 0.5, static_cast<double>(a_RelBlockY) + 0.1, static_cast<double>(BlockZ) + 0.5, 0.3F, 0.6F);
+ }
m_Chunk->SetMeta(a_RelBlockX, a_RelBlockY, a_RelBlockZ, 0x0);
SetSourceUnpowered(a_RelBlockX, a_RelBlockY, a_RelBlockZ, m_Chunk);
}