1
0
cuberite-2a/src/Blocks/BlockRedstone.h

59 lines
969 B
C
Raw Normal View History

#pragma once
#include "BlockHandler.h"
2014-10-19 13:01:01 +00:00
#include "BlockSlab.h"
class cBlockRedstoneHandler :
public cClearMetaOnDrop<cBlockHandler>
{
using super = cClearMetaOnDrop<cBlockHandler>;
public:
cBlockRedstoneHandler(BLOCKTYPE a_BlockType):
super(a_BlockType)
{
}
2014-10-19 13:01:01 +00:00
2014-02-01 13:06:32 +00:00
virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override
{
2014-10-19 13:01:01 +00: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;
}
2016-02-05 21:45:45 +00:00
2015-06-30 14:50:15 +00:00
virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override
{
UNUSED(a_Meta);
return 0;
}
} ;