diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2020-09-23 17:06:27 +0200 |
---|---|---|
committer | Alexander Harkness <me@bearbin.net> | 2020-09-25 11:07:01 +0200 |
commit | c53a0ba5f6f71da384a45a07685f8e25c3f91a29 (patch) | |
tree | bc8d016d1f5c5b5206b3b4f5580295bd91bb6099 /src/Blocks/BlockEntity.h | |
parent | Small cleanup in Jukeboxes (diff) | |
download | cuberite-c53a0ba5f6f71da384a45a07685f8e25c3f91a29.tar cuberite-c53a0ba5f6f71da384a45a07685f8e25c3f91a29.tar.gz cuberite-c53a0ba5f6f71da384a45a07685f8e25c3f91a29.tar.bz2 cuberite-c53a0ba5f6f71da384a45a07685f8e25c3f91a29.tar.lz cuberite-c53a0ba5f6f71da384a45a07685f8e25c3f91a29.tar.xz cuberite-c53a0ba5f6f71da384a45a07685f8e25c3f91a29.tar.zst cuberite-c53a0ba5f6f71da384a45a07685f8e25c3f91a29.zip |
Diffstat (limited to 'src/Blocks/BlockEntity.h')
-rw-r--r-- | src/Blocks/BlockEntity.h | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/src/Blocks/BlockEntity.h b/src/Blocks/BlockEntity.h index b1aee7526..4b9de1f12 100644 --- a/src/Blocks/BlockEntity.h +++ b/src/Blocks/BlockEntity.h @@ -4,7 +4,6 @@ #include "BlockHandler.h" #include "ChunkInterface.h" #include "../Item.h" -#include "../BlockEntities/BlockEntityWithItems.h" @@ -44,37 +43,3 @@ private: return true; } }; - - - - - -/** Wrapper for blocks that have a cBlockEntityWithItems descendant attached to them. -When converting to pickups, drops self with meta reset to zero, and adds the container contents. */ -template <typename Base = cBlockEntityHandler> -class cContainerEntityHandler: - public Base -{ -public: - - constexpr cContainerEntityHandler(BLOCKTYPE a_BlockType): - Base(a_BlockType) - { - } - -private: - - virtual cItems ConvertToPickups(NIBBLETYPE a_BlockMeta, cBlockEntity * a_BlockEntity, const cEntity * a_Digger, const cItem * a_Tool) const override - { - // Reset meta to 0 - cItems res(cItem(Base::m_BlockType, 1, 0)); - - // Drop the contents: - if (a_BlockEntity != nullptr) - { - auto container = static_cast<cBlockEntityWithItems *>(a_BlockEntity); - res.AddItemGrid(container->GetContents()); - } - return res; - } -}; |