summaryrefslogtreecommitdiffstats
path: root/src/Chunk.cpp
diff options
context:
space:
mode:
authorTycho Bickerstaff <work.tycho@gmail.com>2013-12-11 00:01:35 +0100
committerTycho Bickerstaff <work.tycho@gmail.com>2013-12-11 00:01:35 +0100
commitdd633d5a947771cd37f8a853ceb44660752a7e3c (patch)
tree0141233cb7025eaca681513b6670b325c76f57c1 /src/Chunk.cpp
parentadded tolua++ command and removed stackwalker from build (diff)
parentMerge branch 'master' of https://github.com/mc-server/MCServer (diff)
downloadcuberite-dd633d5a947771cd37f8a853ceb44660752a7e3c.tar
cuberite-dd633d5a947771cd37f8a853ceb44660752a7e3c.tar.gz
cuberite-dd633d5a947771cd37f8a853ceb44660752a7e3c.tar.bz2
cuberite-dd633d5a947771cd37f8a853ceb44660752a7e3c.tar.lz
cuberite-dd633d5a947771cd37f8a853ceb44660752a7e3c.tar.xz
cuberite-dd633d5a947771cd37f8a853ceb44660752a7e3c.tar.zst
cuberite-dd633d5a947771cd37f8a853ceb44660752a7e3c.zip
Diffstat (limited to 'src/Chunk.cpp')
-rw-r--r--src/Chunk.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp
index 9c195fdf8..42969bf6d 100644
--- a/src/Chunk.cpp
+++ b/src/Chunk.cpp
@@ -706,8 +706,7 @@ void cChunk::ProcessQueuedSetBlocks(void)
{
// Current world age is bigger than/equal to target world age - delay time reached AND
// Previous block type was the same as current block type (to prevent duplication)
- // Since blocktypes were the same, we just need to set the meta
- SetMeta(itr->m_RelX, itr->m_RelY, itr->m_RelZ, itr->m_BlockMeta);
+ SetBlock(itr->m_RelX, itr->m_RelY, itr->m_RelZ, itr->m_BlockType, itr->m_BlockMeta); // SetMeta doesn't send to client
itr = m_SetBlockQueue.erase(itr);
LOGD("Successfully set queued block - previous and current types matched");
}
@@ -1335,6 +1334,7 @@ void cChunk::WakeUpSimulators(void)
{
cSimulator * WaterSimulator = m_World->GetWaterSimulator();
cSimulator * LavaSimulator = m_World->GetLavaSimulator();
+ cSimulator * RedstoneSimulator = m_World->GetRedstoneSimulator();
int BaseX = m_PosX * cChunkDef::Width;
int BaseZ = m_PosZ * cChunkDef::Width;
for (int x = 0; x < Width; x++)
@@ -1345,7 +1345,16 @@ void cChunk::WakeUpSimulators(void)
int BlockZ = z + BaseZ;
for (int y = GetHeight(x, z); y >= 0; y--)
{
- switch (cChunkDef::GetBlock(m_BlockTypes, x, y, z))
+ BLOCKTYPE Block = cChunkDef::GetBlock(m_BlockTypes, x, y, z);
+
+ // The redstone sim takes multiple blocks, use the inbuilt checker
+ if (RedstoneSimulator->IsAllowedBlock(Block))
+ {
+ RedstoneSimulator->AddBlock(BlockX, y, BlockZ, this);
+ continue;
+ }
+
+ switch (Block)
{
case E_BLOCK_WATER:
{
@@ -1357,6 +1366,10 @@ void cChunk::WakeUpSimulators(void)
LavaSimulator->AddBlock(BlockX, y, BlockZ, this);
break;
}
+ default:
+ {
+ break;
+ }
} // switch (BlockType)
} // for y
} // for z