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

62 lines
873 B
C
Raw Normal View History

#pragma once
#include "BlockHandler.h"
/** Handler for the small (singleblock) mushrooms. */
class cBlockMushroomHandler:
public cClearMetaOnDrop<cBlockHandler>
{
2020-04-13 16:38:06 +00:00
using Super = cClearMetaOnDrop<cBlockHandler>;
public:
using Super::Super;
private:
2014-03-16 15:06:03 +00:00
// TODO: Add Mushroom Spread
virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, const Vector3i a_RelPos, const cChunk & a_Chunk) const override
{
if (a_RelPos.y <= 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_RelPos.addedY(-1)))
{
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) const override
2015-06-30 14:50:15 +00:00
{
UNUSED(a_Meta);
return 0;
}
} ;