1
0
Fork 0
cuberite-2a/src/Blocks/BlockMushroom.h

61 lines
963 B
C
Raw Normal View History

#pragma once
#include "BlockHandler.h"
class cBlockMushroomHandler :
public cBlockHandler
{
public:
cBlockMushroomHandler(BLOCKTYPE a_BlockType)
: cBlockHandler(a_BlockType)
{
}
2014-03-16 15:06:03 +00:00
// TODO: Add Mushroom Spread
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
{
// Reset meta to 0
a_Pickups.push_back(cItem(m_BlockType, 1, 0));
}
2014-02-01 13:06:32 +00:00
virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override
{
if (a_RelY <= 0)
{
return false;
}
2016-02-05 21:45:45 +00:00
// TODO: Cannot be at too much daylight
2016-02-05 21:45:45 +00:00
switch (a_Chunk.GetBlock(a_RelX, a_RelY - 1, a_RelZ))
{
case E_BLOCK_GLASS:
case E_BLOCK_CACTUS:
case E_BLOCK_ICE:
case E_BLOCK_LEAVES:
2014-03-16 13:01:22 +00:00
case E_BLOCK_NEW_LEAVES:
case E_BLOCK_AIR:
{
return false;
}
}
return true;
}
2015-06-30 14:50:15 +00:00
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override
{
UNUSED(a_Meta);
return 0;
}
} ;