1
0
cuberite-2a/src/Blocks/BlockMobHead.h

50 lines
789 B
C
Raw Normal View History

2014-02-18 15:40:02 -05:00
#pragma once
#include "BlockEntity.h"
2014-02-19 08:45:09 -05:00
#include "../BlockEntities/MobHeadEntity.h"
2014-02-18 15:40:02 -05:00
2014-02-19 08:45:09 -05:00
class cBlockMobHeadHandler :
2014-02-18 15:40:02 -05:00
public cBlockEntityHandler
{
2020-04-13 12:38:06 -04:00
using Super = cBlockEntityHandler;
2014-02-18 15:40:02 -05:00
public:
cBlockMobHeadHandler(BLOCKTYPE a_BlockType):
2020-04-13 12:38:06 -04:00
Super(a_BlockType)
2014-02-18 15:40:02 -05:00
{
}
virtual cItems ConvertToPickups(NIBBLETYPE a_BlockMeta, cBlockEntity * a_BlockEntity, const cEntity * a_Digger, const cItem * a_Tool) override
2014-05-28 09:54:43 -04:00
{
if ((a_BlockEntity == nullptr) || (a_BlockEntity->GetBlockType() != E_BLOCK_HEAD))
2014-05-28 09:54:43 -04:00
{
return {};
2014-05-28 09:54:43 -04:00
}
auto mobHeadEntity = static_cast<cMobHeadEntity *>(a_BlockEntity);
return cItem(E_ITEM_HEAD, 1, static_cast<short>(mobHeadEntity->GetType()));
2014-02-18 15:40:02 -05:00
}
2015-06-30 10:50:15 -04:00
2015-06-30 10:50:15 -04:00
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override
{
UNUSED(a_Meta);
return 0;
}
2014-02-18 15:40:02 -05:00
} ;