From ab62fc398818d717b54110b13e1b3af48e07b686 Mon Sep 17 00:00:00 2001 From: Alexander Harkness Date: Thu, 7 Nov 2024 20:03:21 +0000 Subject: Clean up CanBeAt Functions (#5587) * Use cChunkDef::IsValidHeight for CanBeAt functions, and related helpers. * Add mixins for SolidSurfaceUnderneat and DirtLikeUnderneath * Minor fixes after change review. --- src/Blocks/BlockStandingBanner.h | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) (limited to 'src/Blocks/BlockStandingBanner.h') diff --git a/src/Blocks/BlockStandingBanner.h b/src/Blocks/BlockStandingBanner.h index 391b7fde7..0cc7c28eb 100644 --- a/src/Blocks/BlockStandingBanner.h +++ b/src/Blocks/BlockStandingBanner.h @@ -5,15 +5,16 @@ #include "../BlockInfo.h" #include "BlockEntity.h" +#include "Mixins/SolidSurfaceUnderneath.h" class cBlockStandingBannerHandler final : - public cBlockEntityHandler + public cSolidSurfaceUnderneath { - using Super = cBlockEntityHandler; + using Super = cSolidSurfaceUnderneath; public: @@ -29,20 +30,6 @@ public: - virtual bool CanBeAt(const cChunk & a_Chunk, const Vector3i a_Position, const NIBBLETYPE a_Meta) const override - { - if (a_Position.y < 1) - { - return false; - } - - return cBlockInfo::IsSolid(a_Chunk.GetBlock(a_Position.addedY(-1))); - } - - - - - virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) const override { UNUSED(a_Meta); -- cgit v1.2.3