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

52 lines
822 B
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 cBlockTallGrassHandler :
public cBlockHandler
2012-07-15 20:36:34 +00:00
{
public:
cBlockTallGrassHandler(BLOCKTYPE a_BlockType)
: cBlockHandler(a_BlockType)
2012-07-15 20:36:34 +00:00
{
}
virtual bool DoesIgnoreBuildCollision(void) override
2012-07-15 20:36:34 +00:00
{
return true;
}
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
2012-07-15 20:36:34 +00:00
{
// Drop seeds, sometimes
2012-07-15 20:36:34 +00:00
MTRand r1;
if (r1.randInt(10) == 5)
{
a_Pickups.push_back(cItem(E_ITEM_SEEDS, 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
{
return ((a_RelY > 0) && (a_Chunk.GetBlock(a_RelX, a_RelY - 1, a_RelZ) != E_BLOCK_AIR));
2012-07-15 20:36:34 +00:00
}
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";
}
} ;
2012-09-11 12:01:34 +00:00