2014-03-23 18:32:45 -04:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "BlockHandler.h"
|
2014-03-28 18:51:30 -04:00
|
|
|
#include "Entities/Pickup.h"
|
2014-03-23 18:32:45 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class cBlockLilypadHandler :
|
2014-07-14 19:01:16 -04:00
|
|
|
public cClearMetaOnDrop<cBlockHandler>
|
2014-03-23 18:32:45 -04:00
|
|
|
{
|
2014-07-15 08:54:24 -04:00
|
|
|
typedef cClearMetaOnDrop<cBlockHandler> super;
|
2014-03-23 18:32:45 -04:00
|
|
|
public:
|
2014-07-15 08:54:24 -04:00
|
|
|
|
|
|
|
cBlockLilypadHandler(BLOCKTYPE a_BlockType) :
|
|
|
|
super(a_BlockType)
|
2014-03-23 18:32:45 -04:00
|
|
|
{
|
|
|
|
}
|
2015-06-30 10:50:15 -04:00
|
|
|
|
|
|
|
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override
|
|
|
|
{
|
|
|
|
UNUSED(a_Meta);
|
|
|
|
return 7;
|
|
|
|
}
|
2015-09-25 05:16:08 -04:00
|
|
|
|
|
|
|
|
|
|
|
virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override
|
|
|
|
{
|
|
|
|
if ((a_RelY < 1) || (a_RelY >= cChunkDef::Height))
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
BLOCKTYPE UnderType;
|
|
|
|
NIBBLETYPE UnderMeta;
|
|
|
|
a_Chunk.GetBlockTypeMeta(a_RelX, a_RelY - 1, a_RelZ, UnderType, UnderMeta);
|
|
|
|
return (
|
|
|
|
((UnderType == E_BLOCK_STATIONARY_WATER) || (UnderType == E_BLOCK_WATER)) && // Water is below...
|
|
|
|
(UnderMeta == 0) // ... and it's a source
|
|
|
|
);
|
|
|
|
}
|
2014-03-23 18:32:45 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|