summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-02-20 19:21:04 +0100
committerHowaner <franzi.moos@googlemail.com>2014-02-20 19:21:04 +0100
commit4dd39f8cd6e8f0894989e4270e0501dab7ae8f4d (patch)
treea65da64431e2189f1d49780d6c6aea7e9c338c29 /src
parentAdd Light weighted pressure plates (diff)
downloadcuberite-4dd39f8cd6e8f0894989e4270e0501dab7ae8f4d.tar
cuberite-4dd39f8cd6e8f0894989e4270e0501dab7ae8f4d.tar.gz
cuberite-4dd39f8cd6e8f0894989e4270e0501dab7ae8f4d.tar.bz2
cuberite-4dd39f8cd6e8f0894989e4270e0501dab7ae8f4d.tar.lz
cuberite-4dd39f8cd6e8f0894989e4270e0501dab7ae8f4d.tar.xz
cuberite-4dd39f8cd6e8f0894989e4270e0501dab7ae8f4d.tar.zst
cuberite-4dd39f8cd6e8f0894989e4270e0501dab7ae8f4d.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 ca4bcca04..b6c573a62 100644
--- a/src/Simulator/IncrementalRedstoneSimulator.cpp
+++ b/src/Simulator/IncrementalRedstoneSimulator.cpp
@@ -1093,13 +1093,22 @@ void cIncrementalRedstoneSimulator::HandlePressurePlate(int a_BlockX, int a_Bloc
cPressurePlateCallback PressurePlateCallback(a_BlockX, a_BlockY, a_BlockZ, &m_World);
m_World.ForEachEntity(PressurePlateCallback);
+ NIBBLETYPE Meta = m_World.GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ);
if (PressurePlateCallback.FoundEntity())
{
+ if (Meta == 0x0)
+ {
+ m_World.BroadcastSoundEffect("random.click", (int) ((a_BlockX + 0.5) * 8.0), (int) ((a_BlockY + 0.1) * 8.0), (int) ((a_BlockZ + 0.5) * 8.0), 0.3F, 0.5F);
+ }
m_World.SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, 0x1);
SetAllDirsAsPowered(a_BlockX, a_BlockY, a_BlockZ, a_MyType);
}
else
{
+ if (Meta == 0x1)
+ {
+ m_World.BroadcastSoundEffect("random.click", (int) ((a_BlockX + 0.5) * 8.0), (int) ((a_BlockY + 0.1) * 8.0), (int) ((a_BlockZ + 0.5) * 8.0), 0.3F, 0.6F);
+ }
m_World.SetBlockMeta(a_BlockX, a_BlockY, a_BlockZ, 0x0);
m_World.WakeUpSimulators(a_BlockX, a_BlockY, a_BlockZ);
}