diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2020-09-20 15:50:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-20 15:50:52 +0200 |
commit | 68cced73afe546328cf94ed07c57deee47bfadec (patch) | |
tree | 88be88e3fd4a208b9849e526f1877caa44058ab5 /src/Blocks/BlockEntity.h | |
parent | Added armor and shulker box cleaning (#4875) (diff) | |
download | cuberite-68cced73afe546328cf94ed07c57deee47bfadec.tar cuberite-68cced73afe546328cf94ed07c57deee47bfadec.tar.gz cuberite-68cced73afe546328cf94ed07c57deee47bfadec.tar.bz2 cuberite-68cced73afe546328cf94ed07c57deee47bfadec.tar.lz cuberite-68cced73afe546328cf94ed07c57deee47bfadec.tar.xz cuberite-68cced73afe546328cf94ed07c57deee47bfadec.tar.zst cuberite-68cced73afe546328cf94ed07c57deee47bfadec.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Blocks/BlockEntity.h | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/Blocks/BlockEntity.h b/src/Blocks/BlockEntity.h index 9fbb77a1f..b1aee7526 100644 --- a/src/Blocks/BlockEntity.h +++ b/src/Blocks/BlockEntity.h @@ -19,14 +19,9 @@ class cBlockEntityHandler: public: - cBlockEntityHandler(BLOCKTYPE a_BlockType): - Super(a_BlockType) - { - } - - - + using Super::Super; +private: virtual bool OnUse( cChunkInterface & a_ChunkInterface, @@ -35,7 +30,7 @@ public: const Vector3i a_BlockPos, eBlockFace a_BlockFace, const Vector3i a_CursorPos - ) override + ) const override { return a_ChunkInterface.UseBlockEntity(&a_Player, a_BlockPos.x, a_BlockPos.y, a_BlockPos.z); } @@ -44,7 +39,7 @@ public: - virtual bool IsUseable() override + virtual bool IsUseable() const override { return true; } @@ -62,16 +57,14 @@ class cContainerEntityHandler: { public: - cContainerEntityHandler(BLOCKTYPE a_BlockType): + 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) override + 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)); |