From c53a0ba5f6f71da384a45a07685f8e25c3f91a29 Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Wed, 23 Sep 2020 16:06:27 +0100 Subject: Unify block entity pickup conversion - Removed normal BlockHandler knowledge of block entities during conversion + Added cBlockEntity::ConvertToPickups that handles it --- src/Blocks/BlockEnderchest.h | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/Blocks/BlockEnderchest.h') diff --git a/src/Blocks/BlockEnderchest.h b/src/Blocks/BlockEnderchest.h index 93009da64..fe5835f9a 100644 --- a/src/Blocks/BlockEnderchest.h +++ b/src/Blocks/BlockEnderchest.h @@ -1,7 +1,6 @@ #pragma once -#include "BlockEntity.h" #include "Mixins.h" @@ -18,7 +17,7 @@ public: private: - virtual cItems ConvertToPickups(NIBBLETYPE a_BlockMeta, cBlockEntity * a_BlockEntity, const cEntity * a_Digger, const cItem * a_Tool) const override + virtual cItems ConvertToPickups(NIBBLETYPE a_BlockMeta, const cEntity * a_Digger, const cItem * a_Tool) const override { // Only drop something when mined with a pickaxe: if ( @@ -29,13 +28,12 @@ private: // Only drop self when mined with a silk-touch pickaxe: if (a_Tool->m_Enchantments.GetLevel(cEnchantments::enchSilkTouch) > 0) { - return cItem(E_BLOCK_ENDER_CHEST, 1, 0); - } - else - { - return cItem(E_BLOCK_OBSIDIAN, 8, 0); + return cItem(E_BLOCK_ENDER_CHEST); } + + return cItem(E_BLOCK_OBSIDIAN, 8); } + return {}; } -- cgit v1.2.3