2014-03-23 18:32:45 -04:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "BlockHandler.h"
|
2017-08-06 15:57:44 -04:00
|
|
|
|
2014-03-23 18:32:45 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-04-13 12:38:06 -04:00
|
|
|
class cBlockLilypadHandler:
|
2014-07-14 19:01:16 -04:00
|
|
|
public cClearMetaOnDrop<cBlockHandler>
|
2014-03-23 18:32:45 -04:00
|
|
|
{
|
2020-04-13 12:38:06 -04:00
|
|
|
using Super = cClearMetaOnDrop<cBlockHandler>;
|
|
|
|
|
2014-03-23 18:32:45 -04:00
|
|
|
public:
|
2014-07-15 08:54:24 -04:00
|
|
|
|
2020-04-13 12:38:06 -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 (
|
2017-12-27 13:47:28 -05:00
|
|
|
(((UnderType == E_BLOCK_STATIONARY_WATER) || (UnderType == E_BLOCK_WATER)) && (UnderMeta == 0)) || // A water source is below
|
|
|
|
(UnderType == E_BLOCK_ICE) || (UnderType == E_BLOCK_FROSTED_ICE) // Or (frosted) ice
|
2015-09-25 05:16:08 -04:00
|
|
|
);
|
|
|
|
}
|
2014-03-23 18:32:45 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|