2012-07-15 16:36:34 -04:00
|
|
|
#pragma once
|
|
|
|
#include "Block.h"
|
|
|
|
#include "../MersenneTwister.h"
|
|
|
|
#include "../cWorld.h"
|
|
|
|
|
|
|
|
class cBlockStemsHandler : public cBlockHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
cBlockStemsHandler(BLOCKTYPE a_BlockID)
|
|
|
|
: cBlockHandler(a_BlockID)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2012-07-16 15:20:37 -04:00
|
|
|
virtual bool NeedsRandomTicks() override
|
2012-07-15 16:36:34 -04:00
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2012-07-16 15:20:37 -04:00
|
|
|
virtual NIBBLETYPE GetDropMeta(NIBBLETYPE a_BlockMeta) override
|
2012-07-15 16:36:34 -04:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2012-07-16 15:20:37 -04:00
|
|
|
virtual int GetDropID() override
|
2012-07-15 16:36:34 -04:00
|
|
|
{
|
|
|
|
if(m_BlockID == E_BLOCK_MELON_STEM)
|
|
|
|
return E_ITEM_MELON_SEEDS;
|
|
|
|
return E_ITEM_PUMPKIN_SEEDS;
|
|
|
|
}
|
|
|
|
|
2012-07-16 15:20:37 -04:00
|
|
|
void OnUpdate(cWorld *a_World, int a_X, int a_Y, int a_Z) override
|
2012-07-15 16:36:34 -04:00
|
|
|
{
|
|
|
|
//TODO: Handle Growing here
|
|
|
|
}
|
|
|
|
|
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_FARMLAND;
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|