From c53a0ba5f6f71da384a45a07685f8e25c3f91a29 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Wed, 23 Sep 2020 16:06:27 +0100 Subject: Unify block entity pickup conversion - Removed normal BlockHandler knowledge of block entities during conversion + Added cBlockEntity::ConvertToPickups that handles it --- src/BlockEntities/BlockEntity.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/BlockEntities/BlockEntity.h') diff --git a/src/BlockEntities/BlockEntity.h b/src/BlockEntities/BlockEntity.h index 474192107..6232eb1ef 100644 --- a/src/BlockEntities/BlockEntity.h +++ b/src/BlockEntities/BlockEntity.h @@ -29,6 +29,7 @@ class cChunk; +class cItems; class cPlayer; class cWorld; class cBlockEntity; @@ -83,6 +84,10 @@ public: Uses CopyFrom() to copy the properties. */ OwnedBlockEntity Clone(Vector3i a_Pos); + /** Returns the contents of this block entity that it would drop if broken. + Note that the block itself is not included; that's handled by the block handler. */ + virtual cItems ConvertToPickups() const; + /** Copies all properties of a_Src into this entity, except for its m_World and location. Each non-abstract descendant should override to copy its specific properties, and call Super::CopyFrom(a_Src) to copy the common ones. */ -- cgit v1.2.3