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/HopperEntity.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/BlockEntities/HopperEntity.h') diff --git a/src/BlockEntities/HopperEntity.h b/src/BlockEntities/HopperEntity.h index e11b2cc4d..c57dce672 100644 --- a/src/BlockEntities/HopperEntity.h +++ b/src/BlockEntities/HopperEntity.h @@ -19,7 +19,11 @@ class cHopperEntity : public cBlockEntityWithItems { - typedef cBlockEntityWithItems Super; + // tolua_end + + using super = cBlockEntityWithItems; + + // tolua_begin public: enum @@ -34,12 +38,12 @@ public: BLOCKENTITY_PROTODEF(cHopperEntity) /** Constructor used for normal operation */ - cHopperEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World); + cHopperEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Vector3i a_Pos, cWorld * a_World); /** Returns the block coords of the block receiving the output items, based on the meta - Returns false if unattached. + Returns if unattached. Exported in ManualBindings.cpp. */ - bool GetOutputBlockPos(NIBBLETYPE a_BlockMeta, int & a_OutputX, int & a_OutputY, int & a_OutputZ); + std::pair GetOutputBlockPos(NIBBLETYPE a_BlockMeta); protected: @@ -76,11 +80,11 @@ protected: /** Moves one piece from the specified itemstack into this hopper. Returns true if contents have changed. Doesn't change the itemstack. */ bool MoveItemsFromSlot(cBlockEntityWithItems & a_Entity, int a_SrcSlotNum); - /** Moves items to the chest at the specified coords. Returns true if contents have changed */ - bool MoveItemsToChest(cChunk & a_Chunk, int a_BlockX, int a_BlockY, int a_BlockZ); + /** Moves items to the chest at the specified absolute coords. Returns true if contents have changed */ + bool MoveItemsToChest(cChunk & a_Chunk, Vector3i a_Coords); - /** Moves items to the furnace at the specified coords. Returns true if contents have changed */ - bool MoveItemsToFurnace(cChunk & a_Chunk, int a_BlockX, int a_BlockY, int a_BlockZ, NIBBLETYPE a_HopperMeta); + /** Moves items to the furnace at the specified absolute coords. Returns true if contents have changed */ + bool MoveItemsToFurnace(cChunk & a_Chunk, Vector3i a_Coords, NIBBLETYPE a_HopperMeta); /** Moves items to the specified ItemGrid. Returns true if contents have changed */ bool MoveItemsToGrid(cBlockEntityWithItems & a_Entity); -- cgit v1.2.3