summaryrefslogtreecommitdiffstats
path: root/src/BlockEntities
diff options
context:
space:
mode:
authorAlexander Harkness <me@bearbin.net>2015-06-09 10:15:08 +0200
committerAlexander Harkness <me@bearbin.net>2015-06-09 10:15:08 +0200
commit1e77f271916ee1d1ee8c0047234662c29d2057bc (patch)
tree85cc42b6f276ff368ed70cc6e50d7000807652c7 /src/BlockEntities
parentMerge pull request #2221 from mc-server/AreaCountBlocks (diff)
parentAdded moar comments (diff)
downloadcuberite-1e77f271916ee1d1ee8c0047234662c29d2057bc.tar
cuberite-1e77f271916ee1d1ee8c0047234662c29d2057bc.tar.gz
cuberite-1e77f271916ee1d1ee8c0047234662c29d2057bc.tar.bz2
cuberite-1e77f271916ee1d1ee8c0047234662c29d2057bc.tar.lz
cuberite-1e77f271916ee1d1ee8c0047234662c29d2057bc.tar.xz
cuberite-1e77f271916ee1d1ee8c0047234662c29d2057bc.tar.zst
cuberite-1e77f271916ee1d1ee8c0047234662c29d2057bc.zip
Diffstat (limited to 'src/BlockEntities')
-rw-r--r--src/BlockEntities/BlockEntity.h2
-rw-r--r--src/BlockEntities/ChestEntity.h18
2 files changed, 19 insertions, 1 deletions
diff --git a/src/BlockEntities/BlockEntity.h b/src/BlockEntities/BlockEntity.h
index 85f75a523..7b5b6920f 100644
--- a/src/BlockEntities/BlockEntity.h
+++ b/src/BlockEntities/BlockEntity.h
@@ -91,7 +91,7 @@ public:
BLOCKTYPE GetBlockType(void) const { return m_BlockType; }
- cWorld * GetWorld(void) const {return m_World; }
+ cWorld * GetWorld(void) const { return m_World; }
int GetChunkX(void) const { return FAST_FLOOR_DIV(m_PosX, cChunkDef::Width); }
int GetChunkZ(void) const { return FAST_FLOOR_DIV(m_PosZ, cChunkDef::Width); }
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