2013-07-29 07:13:03 -04:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "BlockHandler.h"
|
2014-10-19 09:01:01 -04:00
|
|
|
#include "BlockSlab.h"
|
2013-07-29 07:13:03 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class cBlockRedstoneHandler :
|
2019-10-16 04:06:34 -04:00
|
|
|
public cClearMetaOnDrop<cBlockHandler>
|
2013-07-29 07:13:03 -04:00
|
|
|
{
|
2019-10-16 04:06:34 -04:00
|
|
|
using super = cClearMetaOnDrop<cBlockHandler>;
|
|
|
|
|
2013-07-29 07:13:03 -04:00
|
|
|
public:
|
2019-10-16 04:06:34 -04:00
|
|
|
|
|
|
|
cBlockRedstoneHandler(BLOCKTYPE a_BlockType):
|
|
|
|
super(a_BlockType)
|
2013-11-29 17:25:07 -05:00
|
|
|
{
|
|
|
|
}
|
2014-10-19 09:01:01 -04:00
|
|
|
|
2014-02-01 08:06:32 -05:00
|
|
|
virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override
|
2013-07-29 07:13:03 -04:00
|
|
|
{
|
2014-10-19 09:01:01 -04:00
|
|
|
if (a_RelY <= 0)
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
BLOCKTYPE BelowBlock;
|
|
|
|
NIBBLETYPE BelowBlockMeta;
|
|
|
|
a_Chunk.GetBlockTypeMeta(a_RelX, a_RelY - 1, a_RelZ, BelowBlock, BelowBlockMeta);
|
|
|
|
|
|
|
|
if (cBlockInfo::FullyOccupiesVoxel(BelowBlock))
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else if (cBlockSlabHandler::IsAnySlabType(BelowBlock))
|
|
|
|
{
|
|
|
|
// Check if the slab is turned up side down
|
|
|
|
if ((BelowBlockMeta & 0x08) == 0x08)
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
2013-07-29 07:13:03 -04:00
|
|
|
}
|
2016-02-05 16:45:45 -05:00
|
|
|
|
2015-06-30 10:50:15 -04:00
|
|
|
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override
|
|
|
|
{
|
|
|
|
UNUSED(a_Meta);
|
|
|
|
return 0;
|
|
|
|
}
|
2013-07-29 07:13:03 -04:00
|
|
|
} ;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|