summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-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);