summaryrefslogtreecommitdiffstats
path: root/src/BlockEntities
diff options
context:
space:
mode:
authorBond-009 <bond.009@outlook.com>2019-08-11 01:11:57 +0200
committerpeterbell10 <peterbell10@live.co.uk>2019-08-11 01:11:57 +0200
commit4de232bdae7efc3430e37c4fc95c681a909f0b41 (patch)
tree1be7e7d1331f91c0d0ab6bfa7ea1dba5488b1199 /src/BlockEntities
parentAdded null check for position (#4366) (diff)
downloadcuberite-4de232bdae7efc3430e37c4fc95c681a909f0b41.tar
cuberite-4de232bdae7efc3430e37c4fc95c681a909f0b41.tar.gz
cuberite-4de232bdae7efc3430e37c4fc95c681a909f0b41.tar.bz2
cuberite-4de232bdae7efc3430e37c4fc95c681a909f0b41.tar.lz
cuberite-4de232bdae7efc3430e37c4fc95c681a909f0b41.tar.xz
cuberite-4de232bdae7efc3430e37c4fc95c681a909f0b41.tar.zst
cuberite-4de232bdae7efc3430e37c4fc95c681a909f0b41.zip
Diffstat (limited to '')
-rw-r--r--src/BlockEntities/BlockEntityWithItems.cpp8
-rw-r--r--src/BlockEntities/ChestEntity.h8
2 files changed, 16 insertions, 0 deletions
diff --git a/src/BlockEntities/BlockEntityWithItems.cpp b/src/BlockEntities/BlockEntityWithItems.cpp
index 01d217a16..924882820 100644
--- a/src/BlockEntities/BlockEntityWithItems.cpp
+++ b/src/BlockEntities/BlockEntityWithItems.cpp
@@ -8,6 +8,7 @@
#include "Globals.h"
#include "BlockEntityWithItems.h"
+#include "../Simulator/RedstoneSimulator.h"
@@ -68,5 +69,12 @@ void cBlockEntityWithItems::OnSlotChanged(cItemGrid * a_Grid, int a_SlotNum)
}
m_World->MarkChunkDirty(GetChunkX(), GetChunkZ());
+ auto Pos = Vector3i(m_PosX, m_PosY, m_PosZ);
+ m_World->DoWithChunkAt(Pos, [&](cChunk & a_Chunk)
+ {
+ m_World->GetRedstoneSimulator()->WakeUp(Pos, &a_Chunk);
+ return true;
+ }
+ );
}
}
diff --git a/src/BlockEntities/ChestEntity.h b/src/BlockEntities/ChestEntity.h
index dc26e0895..de4c1cce6 100644
--- a/src/BlockEntities/ChestEntity.h
+++ b/src/BlockEntities/ChestEntity.h
@@ -2,6 +2,7 @@
#pragma once
#include "BlockEntityWithItems.h"
+#include "../Simulator/RedstoneSimulator.h"
@@ -89,6 +90,13 @@ private:
}
m_World->MarkChunkDirty(GetChunkX(), GetChunkZ());
+ auto Pos = Vector3i(m_PosX, m_PosY, m_PosZ);
+ m_World->DoWithChunkAt(Pos, [&](cChunk & a_Chunk)
+ {
+ m_World->GetRedstoneSimulator()->WakeUp(Pos, &a_Chunk);
+ return true;
+ }
+ );
}
}