summaryrefslogtreecommitdiffstats
path: root/src/BlockEntities/ChestEntity.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2015-02-08 17:35:10 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2015-06-06 13:21:09 +0200
commitde5b1401f813985300c33c6b3166b115f9a10dd3 (patch)
tree37c44a693a8b3402b8be7ddbcf9e52a8ea9882db /src/BlockEntities/ChestEntity.h
parentMerge pull request #2172 from mc-server/LightingCallbacks (diff)
downloadcuberite-de5b1401f813985300c33c6b3166b115f9a10dd3.tar
cuberite-de5b1401f813985300c33c6b3166b115f9a10dd3.tar.gz
cuberite-de5b1401f813985300c33c6b3166b115f9a10dd3.tar.bz2
cuberite-de5b1401f813985300c33c6b3166b115f9a10dd3.tar.lz
cuberite-de5b1401f813985300c33c6b3166b115f9a10dd3.tar.xz
cuberite-de5b1401f813985300c33c6b3166b115f9a10dd3.tar.zst
cuberite-de5b1401f813985300c33c6b3166b115f9a10dd3.zip
Diffstat (limited to 'src/BlockEntities/ChestEntity.h')
-rw-r--r--src/BlockEntities/ChestEntity.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/BlockEntities/ChestEntity.h b/src/BlockEntities/ChestEntity.h
index 645dbf4bc..8ead8bda0 100644
--- a/src/BlockEntities/ChestEntity.h
+++ b/src/BlockEntities/ChestEntity.h
@@ -53,6 +53,24 @@ private:
/** Number of players who currently have this chest open */
int m_NumActivePlayers;
+
+ /** cItemGrid::cListener overrides: */
+ virtual void OnSlotChanged(cItemGrid * a_Grid, int a_SlotNum)
+ {
+ UNUSED(a_SlotNum);
+ ASSERT(a_Grid == &m_Contents);
+ if (m_World != nullptr)
+ {
+ if (GetWindow() != nullptr)
+ {
+ GetWindow()->BroadcastWholeWindow();
+ }
+
+ m_World->MarkChunkDirty(GetChunkX(), GetChunkZ());
+ m_World->MarkRedstoneDirty(GetChunkX(), GetChunkZ());
+ }
+ }
+
} ; // tolua_export