From a9031b6bae742b333b1b390192fa590f2ecb07ea Mon Sep 17 00:00:00 2001 From: peterbell10 Date: Mon, 5 Oct 2020 11:27:14 +0100 Subject: Fix cmake not adding Werror on clang, and _lots_ of warnings (#4963) * Fix cmake not adding Werror on clang, and _lots_ of warnings * WIP: Build fixes * Cannot make intermediate blockhandler instance * Tiger's changes * Fix BitIndex check * Handle invalid NextState values in cMultiVersionProtocol Co-authored-by: Tiger Wang --- src/Blocks/Mixins.h | 44 +++++++++++++++----------------------------- 1 file changed, 15 insertions(+), 29 deletions(-) (limited to 'src/Blocks/Mixins.h') diff --git a/src/Blocks/Mixins.h b/src/Blocks/Mixins.h index a5c3e751e..0a356fe58 100644 --- a/src/Blocks/Mixins.h +++ b/src/Blocks/Mixins.h @@ -25,33 +25,9 @@ class cBlockLadder: public cMetaRotator -template -class cBlockWithNoDrops: - public Base -{ -public: - - constexpr cBlockWithNoDrops(BLOCKTYPE a_BlockType): - Base(a_BlockType) - { - } - -private: - - virtual cItems ConvertToPickups(NIBBLETYPE a_BlockMeta, const cEntity * a_Digger, const cItem * a_Tool) const override - { - // Don't drop anything: - return {}; - } -}; - - - - - /** Mixin to clear the block's meta value when converting to a pickup. */ template -class cClearMetaOnDrop: +class cClearMetaOnDrop : public Base { public: @@ -61,6 +37,10 @@ public: { } +protected: + + ~cClearMetaOnDrop() = default; + private: virtual cItems ConvertToPickups(NIBBLETYPE a_BlockMeta, const cEntity * a_Digger, const cItem * a_Tool) const override @@ -78,7 +58,7 @@ private: Inherit from this class providing your base class as Base, the BitMask for the direction bits in bitmask and the masked value for the directions in North, East, South, West. There is also an aptional parameter AssertIfNotMatched, set this if it is invalid for a block to exist in any other state. */ template -class cMetaRotator: +class cMetaRotator : public Base { public: @@ -90,6 +70,8 @@ public: protected: + ~cMetaRotator() = default; + virtual NIBBLETYPE MetaRotateCCW(NIBBLETYPE a_Meta) const override { NIBBLETYPE OtherMeta = a_Meta & (~BitMask); @@ -176,7 +158,7 @@ template < NIBBLETYPE West = 0x04, bool AssertIfNotMatched = false > -class cYawRotator: +class cYawRotator : public cMetaRotator { using Super = cMetaRotator; @@ -185,8 +167,6 @@ public: using Super::Super; -public: - virtual bool GetPlacementBlockTypeMeta( cChunkInterface & a_ChunkInterface, cPlayer & a_Player, const Vector3i a_BlockPos, @@ -230,6 +210,10 @@ public: return North; } } + +protected: + + ~cYawRotator() = default; }; @@ -259,6 +243,8 @@ public: protected: + ~cPitchYawRotator() = default; + virtual bool GetPlacementBlockTypeMeta( cChunkInterface & a_ChunkInterface, cPlayer & a_Player, -- cgit v1.2.3