diff options
author | Mat <mail@mathias.is> | 2020-03-24 13:16:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-24 13:16:09 +0100 |
commit | fdca7dc7f174a0bb76d4aad5063bbe99138f477b (patch) | |
tree | 92c9b8fe2e6946b970ee090fd1433965bcdc8727 /src/Blocks | |
parent | When Client sends message longer than 256 bytes, kick him instead of handling message (#4514) (diff) | |
download | cuberite-fdca7dc7f174a0bb76d4aad5063bbe99138f477b.tar cuberite-fdca7dc7f174a0bb76d4aad5063bbe99138f477b.tar.gz cuberite-fdca7dc7f174a0bb76d4aad5063bbe99138f477b.tar.bz2 cuberite-fdca7dc7f174a0bb76d4aad5063bbe99138f477b.tar.lz cuberite-fdca7dc7f174a0bb76d4aad5063bbe99138f477b.tar.xz cuberite-fdca7dc7f174a0bb76d4aad5063bbe99138f477b.tar.zst cuberite-fdca7dc7f174a0bb76d4aad5063bbe99138f477b.zip |
Diffstat (limited to 'src/Blocks')
-rw-r--r-- | src/Blocks/BlockBrewingStand.h | 21 | ||||
-rw-r--r-- | 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<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: @@ -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 { 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<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: @@ -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 { UNUSED(a_Meta); |