From de5b1401f813985300c33c6b3166b115f9a10dd3 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Sun, 8 Feb 2015 16:35:10 +0000 Subject: Comparators --- src/BlockEntities/ChestEntity.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/BlockEntities/ChestEntity.h') 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 -- cgit v1.2.3