Files
cuberite-2a/source/Blocks/BlockMushroom.h
T

72 lines
1.0 KiB
C++
Raw Normal View History

2012-07-15 20:36:34 +00:00
#pragma once
#include "BlockHandler.h"
2012-07-15 20:36:34 +00:00
class cBlockMushroomHandler :
public cBlockHandler
2012-07-15 20:36:34 +00:00
{
public:
cBlockMushroomHandler(BLOCKTYPE a_BlockType)
: cBlockHandler(a_BlockType)
2012-07-15 20:36:34 +00:00
{
}
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
2012-07-15 20:36:34 +00:00
{
// Reset meta to 0
a_Pickups.push_back(cItem(m_BlockType, 1, 0));
2012-07-15 20:36:34 +00:00
}
virtual bool CanBeAt(int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override
2012-07-15 20:36:34 +00:00
{
if (a_RelY <= 0)
{
return false;
}
// TODO: Cannot be at too much daylight
switch (a_Chunk.GetBlock(a_RelX, a_RelY - 1, a_RelZ))
2012-07-15 20:36:34 +00:00
{
case E_BLOCK_GLASS:
case E_BLOCK_CACTUS:
case E_BLOCK_ICE:
case E_BLOCK_LEAVES:
case E_BLOCK_AIR:
{
2012-07-15 20:36:34 +00:00
return false;
}
2012-07-15 20:36:34 +00:00
}
return true;
}
virtual bool DoesAllowBlockOnTop(void) override
2012-07-15 20:36:34 +00:00
{
return false;
}
virtual bool CanBePlacedOnSide(void) override
2012-07-15 20:36:34 +00:00
{
return false;
}
2012-09-11 12:01:34 +00:00
virtual const char * GetStepSound(void) override
2012-09-11 12:01:34 +00:00
{
return "step.grass";
}
} ;