2012-07-15 16:36:34 -04:00
|
|
|
#pragma once
|
|
|
|
#include "Block.h"
|
|
|
|
|
|
|
|
|
|
|
|
class cBlockTallGrassHandler : public cBlockHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
cBlockTallGrassHandler(BLOCKTYPE a_BlockID)
|
|
|
|
: cBlockHandler(a_BlockID)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-07-16 15:20:37 -04:00
|
|
|
virtual bool IgnoreBuildCollision() override
|
2012-07-15 16:36:34 -04:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2012-07-16 15:20:37 -04:00
|
|
|
virtual int GetDropID() override
|
2012-07-15 16:36:34 -04:00
|
|
|
{
|
|
|
|
return E_ITEM_SEEDS;
|
|
|
|
}
|
|
|
|
|
2012-07-16 15:20:37 -04:00
|
|
|
virtual char GetDropCount() override
|
2012-07-15 16:36:34 -04:00
|
|
|
{
|
|
|
|
MTRand r1;
|
|
|
|
if(r1.randInt(10) == 5)
|
|
|
|
return 1;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-07-16 15:20:37 -04:00
|
|
|
virtual bool CanBeAt(cWorld *a_World, int a_X, int a_Y, int a_Z) override
|
2012-07-15 16:36:34 -04:00
|
|
|
{
|
|
|
|
return a_World->GetBlock(a_X, a_Y - 1, a_Z) != E_BLOCK_AIR;
|
|
|
|
}
|
|
|
|
};
|