From 221cc4ec5cb6301743e947eaabed3fecedba796f Mon Sep 17 00:00:00 2001 From: Mattes D Date: Wed, 16 Oct 2019 10:06:34 +0200 Subject: Refactored block-to-pickup conversion. (#4417) --- src/Blocks/BlockTrapdoor.h | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'src/Blocks/BlockTrapdoor.h') diff --git a/src/Blocks/BlockTrapdoor.h b/src/Blocks/BlockTrapdoor.h index 8fdae6028..e5361706c 100644 --- a/src/Blocks/BlockTrapdoor.h +++ b/src/Blocks/BlockTrapdoor.h @@ -2,32 +2,36 @@ #pragma once #include "BlockHandler.h" -#include "MetaRotator.h" +#include "Mixins.h" #include "../EffectID.h" class cBlockTrapdoorHandler : - public cMetaRotator + public cClearMetaOnDrop> { + using super = cClearMetaOnDrop>; + public: - cBlockTrapdoorHandler(BLOCKTYPE a_BlockType) - : cMetaRotator(a_BlockType) - { - } - virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override + cBlockTrapdoorHandler(BLOCKTYPE a_BlockType): + super(a_BlockType) { - // Reset meta to zero - a_Pickups.push_back(cItem(m_BlockType, 1, 0)); } + + + virtual bool IsUseable(void) override { return true; } + + + + virtual bool OnUse(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer & a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) override { if (m_BlockType == E_BLOCK_IRON_TRAPDOOR) -- cgit v1.2.3