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-09-20 09:50:52 -04:00
|
|
|
using Super::Super;
|
2020-04-21 16:19:22 -04:00
|
|
|
|
2020-09-20 09:50:52 -04:00
|
|
|
private:
|
2020-04-21 16:19:22 -04:00
|
|
|
|
2020-09-20 09:50:52 -04:00
|
|
|
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) const override
|
2015-06-30 10:50:15 -04:00
|
|
|
{
|
|
|
|
UNUSED(a_Meta);
|
|
|
|
return 7;
|
|
|
|
}
|
2015-09-25 05:16:08 -04:00
|
|
|
|
|
|
|
|
2020-04-21 16:19:22 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-20 09:50:52 -04:00
|
|
|
virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, const Vector3i a_RelPos, const cChunk & a_Chunk) const override
|
2015-09-25 05:16:08 -04:00
|
|
|
{
|
2020-04-21 16:19:22 -04:00
|
|
|
auto UnderPos = a_RelPos.addedY(-1);
|
|
|
|
if (!cChunkDef::IsValidHeight(UnderPos.y))
|
2015-09-25 05:16:08 -04:00
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
BLOCKTYPE UnderType;
|
|
|
|
NIBBLETYPE UnderMeta;
|
2020-04-21 16:19:22 -04:00
|
|
|
a_Chunk.GetBlockTypeMeta(UnderPos, UnderType, UnderMeta);
|
2015-09-25 05:16:08 -04:00
|
|
|
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
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|