From 221cc4ec5cb6301743e947eaabed3fecedba796f Mon Sep 17 00:00:00 2001 From: Mattes D Date: Wed, 16 Oct 2019 10:06:34 +0200 Subject: Refactored block-to-pickup conversion. (#4417) --- src/BlockArea.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/BlockArea.h') diff --git a/src/BlockArea.h b/src/BlockArea.h index 8f57c8e5e..b7bfded9a 100644 --- a/src/BlockArea.h +++ b/src/BlockArea.h @@ -24,6 +24,7 @@ // fwd: class cCuboid; +class cItems; using cBlockEntityCallback = cFunctionRef; @@ -421,6 +422,9 @@ public: /** Direct read-only access to block entities. */ const cBlockEntities & GetBlockEntities(void) const { ASSERT(HasBlockEntities()); return *m_BlockEntities; } + /** Returns the pickups that would result if the block at the specified position was mined by a_Digger, using a_Tool. */ + cItems PickupsFromBlock(Vector3i a_AbsPos, const cEntity * a_Digger = nullptr, const cItem * a_Tool = nullptr); + protected: @@ -520,6 +524,9 @@ protected: /** Removes from m_BlockEntities those BEs that no longer match the blocktype at their coords. */ void RemoveNonMatchingBlockEntities(void); + /** Returns the cBlockEntity at the specified coords, or nullptr if none. */ + cBlockEntity * GetBlockEntityRel(Vector3i a_RelPos); + // tolua_begin } ; // tolua_end -- cgit v1.2.3