summaryrefslogtreecommitdiffstats
path: root/source/BlockEntityWithItems.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-05-26 17:29:43 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-05-26 17:29:43 +0200
commit84a7e14e86b0bb4025e3c93d6a5d09ee8240a531 (patch)
tree05faa280268a55cadda98e8d6a3526078c1a7653 /source/BlockEntityWithItems.h
parentImplemented droppers (diff)
downloadcuberite-84a7e14e86b0bb4025e3c93d6a5d09ee8240a531.tar
cuberite-84a7e14e86b0bb4025e3c93d6a5d09ee8240a531.tar.gz
cuberite-84a7e14e86b0bb4025e3c93d6a5d09ee8240a531.tar.bz2
cuberite-84a7e14e86b0bb4025e3c93d6a5d09ee8240a531.tar.lz
cuberite-84a7e14e86b0bb4025e3c93d6a5d09ee8240a531.tar.xz
cuberite-84a7e14e86b0bb4025e3c93d6a5d09ee8240a531.tar.zst
cuberite-84a7e14e86b0bb4025e3c93d6a5d09ee8240a531.zip
Diffstat (limited to 'source/BlockEntityWithItems.h')
-rw-r--r--source/BlockEntityWithItems.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/BlockEntityWithItems.h b/source/BlockEntityWithItems.h
index e5753359d..b160b8ed4 100644
--- a/source/BlockEntityWithItems.h
+++ b/source/BlockEntityWithItems.h
@@ -19,6 +19,10 @@
// tolua_begin
class cBlockEntityWithItems :
public cBlockEntity
+ // tolua_end
+ // tolua doesn't seem to support multiple inheritance?
+ , public cItemGrid::cListener
+ // tolua_begin
{
typedef cBlockEntity super;
@@ -34,6 +38,7 @@ public:
super(a_BlockType, a_BlockX, a_BlockY, a_BlockZ, a_World),
m_Contents(a_ItemGridWidth, a_ItemGridHeight)
{
+ m_Contents.AddListener(*this);
}
virtual void Destroy(void) override
@@ -64,6 +69,14 @@ public:
protected:
cItemGrid m_Contents;
+
+ // cItemGrid::cListener overrides:
+ virtual void OnSlotChanged(cItemGrid * a_Grid, int a_SlotNum)
+ {
+ ASSERT(a_Grid == &m_Contents);
+ ASSERT(m_World != NULL);
+ m_World->MarkChunkDirty(GetChunkX(), GetChunkZ());
+ }
} ; // tolua_export