Files
cuberite-2a/src/Blocks/BlockFurnace.h
T

71 lines
1.3 KiB
C++
Raw Normal View History

2013-07-29 12:13:03 +01:00
#pragma once
2014-05-25 13:46:34 +01:00
#include "../Blocks/BlockPiston.h"
2020-03-24 14:16:09 +02:00
#include "../BlockEntities/FurnaceEntity.h"
#include "Mixins.h"
2013-07-29 12:13:03 +01:00
class cBlockFurnaceHandler :
2020-03-24 14:16:09 +02:00
public cMetaRotator<cBlockEntityHandler, 0x07, 0x02, 0x05, 0x03, 0x04>
2013-07-29 12:13:03 +01:00
{
2020-03-24 14:16:09 +02:00
using super = cMetaRotator<cBlockEntityHandler, 0x07, 0x02, 0x05, 0x03, 0x04>;
2013-07-29 12:13:03 +01:00
public:
cBlockFurnaceHandler(BLOCKTYPE a_BlockType):
super(a_BlockType)
2013-07-29 12:13:03 +01:00
{
}
2016-02-05 23:45:45 +02:00
2013-07-29 12:13:03 +01:00
virtual bool GetPlacementBlockTypeMeta(
2017-07-31 21:17:52 +01:00
cChunkInterface & a_ChunkInterface, cPlayer & a_Player,
2014-07-17 22:50:58 +02:00
int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace,
2013-07-29 12:13:03 +01:00
int a_CursorX, int a_CursorY, int a_CursorZ,
BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta
) override
{
a_BlockType = m_BlockType;
2016-02-05 23:45:45 +02:00
2013-07-29 12:13:03 +01:00
// FIXME: Do not use cPiston class for furnace placement!
2017-07-31 21:17:52 +01:00
a_BlockMeta = cBlockPistonHandler::RotationPitchToMetaData(a_Player.GetYaw(), 0);
2016-02-05 23:45:45 +02:00
2013-07-29 12:13:03 +01:00
return true;
}
2015-06-30 15:50:15 +01:00
2020-03-24 14:16:09 +02:00
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;
}
2015-06-30 15:50:15 +01:00
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override
{
UNUSED(a_Meta);
return 11;
}
2013-07-29 12:13:03 +01:00
} ;