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/BlockEntity.h | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'src/Blocks/BlockEntity.h') diff --git a/src/Blocks/BlockEntity.h b/src/Blocks/BlockEntity.h index 4b9de1f12..c10f5d769 100644 --- a/src/Blocks/BlockEntity.h +++ b/src/Blocks/BlockEntity.h @@ -11,7 +11,7 @@ /** Wrapper for blocks that have a cBlockEntity descendant attached to them and can be "used" by the player. Forwards the "use" event to the block entity. */ -class cBlockEntityHandler: +class cBlockEntityHandler : public cBlockHandler { using Super = cBlockHandler; @@ -20,6 +20,10 @@ public: using Super::Super; +protected: + + ~cBlockEntityHandler() = default; + private: virtual bool OnUse( @@ -34,12 +38,20 @@ private: return a_ChunkInterface.UseBlockEntity(&a_Player, a_BlockPos.x, a_BlockPos.y, a_BlockPos.z); } - - - - virtual bool IsUseable() const override { return true; } }; + + + + + +class cDefaultBlockEntityHandler final : + public cBlockEntityHandler +{ +public: + + using cBlockEntityHandler::cBlockEntityHandler; +}; -- cgit v1.2.3