summaryrefslogtreecommitdiffstats
path: root/source/Simulator/RedstoneSimulator.cpp
diff options
context:
space:
mode:
authornielsbreu@gmail.com <nielsbreu@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-06-22 13:45:41 +0200
committernielsbreu@gmail.com <nielsbreu@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-06-22 13:45:41 +0200
commitc8fc397b431a6cd6c34aafc70796fd3ad9835488 (patch)
tree24f0e6ba9290015dca6aa29af07238009f15786f /source/Simulator/RedstoneSimulator.cpp
parentDispensers spawn fire if it has Flint and steel. (diff)
downloadcuberite-c8fc397b431a6cd6c34aafc70796fd3ad9835488.tar
cuberite-c8fc397b431a6cd6c34aafc70796fd3ad9835488.tar.gz
cuberite-c8fc397b431a6cd6c34aafc70796fd3ad9835488.tar.bz2
cuberite-c8fc397b431a6cd6c34aafc70796fd3ad9835488.tar.lz
cuberite-c8fc397b431a6cd6c34aafc70796fd3ad9835488.tar.xz
cuberite-c8fc397b431a6cd6c34aafc70796fd3ad9835488.tar.zst
cuberite-c8fc397b431a6cd6c34aafc70796fd3ad9835488.zip
Diffstat (limited to 'source/Simulator/RedstoneSimulator.cpp')
-rw-r--r--source/Simulator/RedstoneSimulator.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/Simulator/RedstoneSimulator.cpp b/source/Simulator/RedstoneSimulator.cpp
index e11157c2b..6d1415265 100644
--- a/source/Simulator/RedstoneSimulator.cpp
+++ b/source/Simulator/RedstoneSimulator.cpp
@@ -161,6 +161,11 @@ void cRedstoneSimulator::RefreshTorchesAround(const Vector3i & a_BlockPos)
m_World.SpawnPrimedTNT(a_BlockPos.x + 0.5, a_BlockPos.y + 0.5, a_BlockPos.z + 0.5, 4); // 4 seconds to boom
m_World.SetBlock(a_BlockPos.x, a_BlockPos.y, a_BlockPos.z, E_BLOCK_AIR, 0);
}
+ //Turn a redstone lamp on when it gets powered.
+ if (m_World.GetBlock(a_BlockPos) == E_BLOCK_REDSTONE_LAMP_OFF)
+ {
+ m_World.SetBlock(a_BlockPos.x, a_BlockPos.y, a_BlockPos.z, E_BLOCK_REDSTONE_LAMP_ON, 0);
+ }
//if (m_World.GetBlock(a_BlockPos) == E_BLOCK_DIRT)
//{
// m_World.FastSetBlock(a_BlockPos.x, a_BlockPos.y, a_BlockPos.z, E_BLOCK_STONE, 0);
@@ -168,6 +173,11 @@ void cRedstoneSimulator::RefreshTorchesAround(const Vector3i & a_BlockPos)
}
else
{
+ //Turn a redstone lamp off when it gets powered.
+ if (m_World.GetBlock(a_BlockPos) == E_BLOCK_REDSTONE_LAMP_ON)
+ {
+ m_World.SetBlock(a_BlockPos.x, a_BlockPos.y, a_BlockPos.z, E_BLOCK_REDSTONE_LAMP_OFF, 0);
+ }
//if (m_World.GetBlock(a_BlockPos) == E_BLOCK_STONE)
//{
// m_World.FastSetBlock(a_BlockPos.x, a_BlockPos.y, a_BlockPos.z, E_BLOCK_DIRT, 0);