summaryrefslogtreecommitdiffstats
path: root/src/BlockEntities
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-02-11 23:04:11 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-02-11 23:04:11 +0100
commitc53406f0d4d83f795e2a445059952b61abb12f34 (patch)
treef2dd24480f817f8f1def0a2296be3ce28d30e0d4 /src/BlockEntities
parentMore gcc warnings fixed. (diff)
downloadcuberite-c53406f0d4d83f795e2a445059952b61abb12f34.tar
cuberite-c53406f0d4d83f795e2a445059952b61abb12f34.tar.gz
cuberite-c53406f0d4d83f795e2a445059952b61abb12f34.tar.bz2
cuberite-c53406f0d4d83f795e2a445059952b61abb12f34.tar.lz
cuberite-c53406f0d4d83f795e2a445059952b61abb12f34.tar.xz
cuberite-c53406f0d4d83f795e2a445059952b61abb12f34.tar.zst
cuberite-c53406f0d4d83f795e2a445059952b61abb12f34.zip
Diffstat (limited to 'src/BlockEntities')
-rw-r--r--src/BlockEntities/ChestEntity.cpp15
-rw-r--r--src/BlockEntities/ChestEntity.h1
2 files changed, 16 insertions, 0 deletions
diff --git a/src/BlockEntities/ChestEntity.cpp b/src/BlockEntities/ChestEntity.cpp
index dfbe6ae87..9282da7fd 100644
--- a/src/BlockEntities/ChestEntity.cpp
+++ b/src/BlockEntities/ChestEntity.cpp
@@ -170,3 +170,18 @@ void cChestEntity::OpenNewWindow(void)
+
+void cChestEntity::OnSlotChanged(cItemGrid * a_Grid, int a_SlotNum)
+{
+ super::OnSlotChanged(a_Grid, a_SlotNum);
+
+ cWindow * Window = GetWindow();
+ if (Window != NULL)
+ {
+ Window->BroadcastWholeWindow();
+ }
+}
+
+
+
+
diff --git a/src/BlockEntities/ChestEntity.h b/src/BlockEntities/ChestEntity.h
index 4110de1f3..1f5668f78 100644
--- a/src/BlockEntities/ChestEntity.h
+++ b/src/BlockEntities/ChestEntity.h
@@ -49,6 +49,7 @@ public:
virtual void SaveToJson(Json::Value & a_Value) override;
virtual void SendTo(cClientHandle & a_Client) override;
virtual void UsedBy(cPlayer * a_Player) override;
+ virtual void OnSlotChanged(cItemGrid * a_Grid, int a_SlotNum) override;
/// Opens a new chest window for this chest. Scans for neighbors to open a double chest window, if appropriate.
void OpenNewWindow(void);