From fdca7dc7f174a0bb76d4aad5063bbe99138f477b Mon Sep 17 00:00:00 2001 From: Mat Date: Tue, 24 Mar 2020 14:16:09 +0200 Subject: Furnace and brewing stand drops (#4534) * Furnace drops contents * Brewing stand drops contents * Fix lit furnace drop * Fix brewing stand drop * Style * Style --- src/Blocks/BlockBrewingStand.h | 21 ++++++++++++++++++--- src/Blocks/BlockFurnace.h | 21 ++++++++++++++++++--- 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/src/Blocks/BlockBrewingStand.h b/src/Blocks/BlockBrewingStand.h index 48158ef73..a37b897fa 100644 --- a/src/Blocks/BlockBrewingStand.h +++ b/src/Blocks/BlockBrewingStand.h @@ -1,7 +1,7 @@ #pragma once -#include "BlockEntity.h" +#include "../BlockEntities/BrewingstandEntity.h" #include "Mixins.h" @@ -9,9 +9,9 @@ class cBlockBrewingStandHandler : - public cClearMetaOnDrop> + public cMetaRotator { - using super = cClearMetaOnDrop>; + using super = cMetaRotator; public: @@ -24,6 +24,21 @@ public: + virtual cItems ConvertToPickups(NIBBLETYPE a_BlockMeta, cBlockEntity * a_BlockEntity, const cEntity * a_Digger, const cItem * a_Tool) override + { + cItems res(cItem(E_ITEM_BREWING_STAND, 1)); // We have to drop the item form of a brewing stand + if (a_BlockEntity != nullptr) + { + auto be = static_cast(a_BlockEntity); + res.AddItemGrid(be->GetContents()); + } + return res; + } + + + + + virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override { UNUSED(a_Meta); diff --git a/src/Blocks/BlockFurnace.h b/src/Blocks/BlockFurnace.h index 4a0459bf0..9a59f95f8 100644 --- a/src/Blocks/BlockFurnace.h +++ b/src/Blocks/BlockFurnace.h @@ -1,17 +1,17 @@ #pragma once -#include "BlockEntity.h" #include "../Blocks/BlockPiston.h" +#include "../BlockEntities/FurnaceEntity.h" #include "Mixins.h" class cBlockFurnaceHandler : - public cClearMetaOnDrop> + public cMetaRotator { - using super = cClearMetaOnDrop>; + using super = cMetaRotator; public: @@ -43,6 +43,21 @@ public: + virtual cItems ConvertToPickups(NIBBLETYPE a_BlockMeta, cBlockEntity * a_BlockEntity, const cEntity * a_Digger, const cItem * a_Tool) override + { + cItems res(cItem(E_BLOCK_FURNACE, 1)); // We can't drop a lit furnace + if (a_BlockEntity != nullptr) + { + auto be = static_cast(a_BlockEntity); + res.AddItemGrid(be->GetContents()); + } + return res; + } + + + + + virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override { UNUSED(a_Meta); -- cgit v1.2.3