1
0

Furnace and brewing stand drops (#4534)

* Furnace drops contents

* Brewing stand drops contents

* Fix lit furnace drop

* Fix brewing stand drop

* Style

* Style
This commit is contained in:
Mat 2020-03-24 14:16:09 +02:00 committed by GitHub
parent 08a9991b5a
commit fdca7dc7f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 36 additions and 6 deletions

View File

@ -1,7 +1,7 @@
#pragma once #pragma once
#include "BlockEntity.h" #include "../BlockEntities/BrewingstandEntity.h"
#include "Mixins.h" #include "Mixins.h"
@ -9,9 +9,9 @@
class cBlockBrewingStandHandler : class cBlockBrewingStandHandler :
public cClearMetaOnDrop<cMetaRotator<cBlockEntityHandler, 0x07, 0x02, 0x05, 0x03, 0x04>> public cMetaRotator<cBlockEntityHandler, 0x07, 0x02, 0x05, 0x03, 0x04>
{ {
using super = cClearMetaOnDrop<cMetaRotator<cBlockEntityHandler, 0x07, 0x02, 0x05, 0x03, 0x04>>; using super = cMetaRotator<cBlockEntityHandler, 0x07, 0x02, 0x05, 0x03, 0x04>;
public: 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<cBrewingstandEntity *>(a_BlockEntity);
res.AddItemGrid(be->GetContents());
}
return res;
}
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override
{ {
UNUSED(a_Meta); UNUSED(a_Meta);

View File

@ -1,17 +1,17 @@
#pragma once #pragma once
#include "BlockEntity.h"
#include "../Blocks/BlockPiston.h" #include "../Blocks/BlockPiston.h"
#include "../BlockEntities/FurnaceEntity.h"
#include "Mixins.h" #include "Mixins.h"
class cBlockFurnaceHandler : class cBlockFurnaceHandler :
public cClearMetaOnDrop<cMetaRotator<cBlockEntityHandler, 0x07, 0x02, 0x05, 0x03, 0x04>> public cMetaRotator<cBlockEntityHandler, 0x07, 0x02, 0x05, 0x03, 0x04>
{ {
using super = cClearMetaOnDrop<cMetaRotator<cBlockEntityHandler, 0x07, 0x02, 0x05, 0x03, 0x04>>; using super = cMetaRotator<cBlockEntityHandler, 0x07, 0x02, 0x05, 0x03, 0x04>;
public: 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<cFurnaceEntity *>(a_BlockEntity);
res.AddItemGrid(be->GetContents());
}
return res;
}
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override
{ {
UNUSED(a_Meta); UNUSED(a_Meta);