From 365cbc6e1cea96741e26c9ce912b003f8fd2c62c Mon Sep 17 00:00:00 2001 From: Mattes D Date: Sun, 29 Sep 2019 14:59:24 +0200 Subject: Refactored more of Entities and BlockEntities to use Vector3. (#4403) --- src/BlockEntities/ChestEntity.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/BlockEntities/ChestEntity.h') diff --git a/src/BlockEntities/ChestEntity.h b/src/BlockEntities/ChestEntity.h index de4c1cce6..2e861d48c 100644 --- a/src/BlockEntities/ChestEntity.h +++ b/src/BlockEntities/ChestEntity.h @@ -18,9 +18,14 @@ class cClientHandle; class cChestEntity : public cBlockEntityWithItems { - typedef cBlockEntityWithItems Super; + // tolua_end + + using super = cBlockEntityWithItems; + + // tolua_begin public: + enum { ContentsHeight = 3, @@ -32,7 +37,7 @@ public: BLOCKENTITY_PROTODEF(cChestEntity) /** Constructor used for normal operation */ - cChestEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World); + cChestEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld * a_World); virtual ~cChestEntity() override; @@ -59,6 +64,7 @@ public: /** Sets the number of players who currently have this chest open */ void SetNumberOfPlayers(int a_NumActivePlayers) { m_NumActivePlayers = a_NumActivePlayers; } + private: /** Number of players who currently have this chest open */ @@ -90,10 +96,9 @@ private: } m_World->MarkChunkDirty(GetChunkX(), GetChunkZ()); - auto Pos = Vector3i(m_PosX, m_PosY, m_PosZ); - m_World->DoWithChunkAt(Pos, [&](cChunk & a_Chunk) + m_World->DoWithChunkAt(m_Pos, [&](cChunk & a_Chunk) { - m_World->GetRedstoneSimulator()->WakeUp(Pos, &a_Chunk); + m_World->GetRedstoneSimulator()->WakeUp(m_Pos, &a_Chunk); return true; } ); -- cgit v1.2.3