summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockRedstoneRepeater.h
diff options
context:
space:
mode:
authorJulian Laubstein <julianlaubstein@yahoo.de>2014-10-19 15:01:01 +0200
committerJulian Laubstein <julianlaubstein@yahoo.de>2014-10-19 15:01:01 +0200
commit403f8581cf4a10e8402a129eca3f595eb5c029ab (patch)
tree05581d4ec964904b754735ca4746197834a881b6 /src/Blocks/BlockRedstoneRepeater.h
parentMountain height gen: Added ditches. (diff)
downloadcuberite-403f8581cf4a10e8402a129eca3f595eb5c029ab.tar
cuberite-403f8581cf4a10e8402a129eca3f595eb5c029ab.tar.gz
cuberite-403f8581cf4a10e8402a129eca3f595eb5c029ab.tar.bz2
cuberite-403f8581cf4a10e8402a129eca3f595eb5c029ab.tar.lz
cuberite-403f8581cf4a10e8402a129eca3f595eb5c029ab.tar.xz
cuberite-403f8581cf4a10e8402a129eca3f595eb5c029ab.tar.zst
cuberite-403f8581cf4a10e8402a129eca3f595eb5c029ab.zip
Diffstat (limited to '')
-rw-r--r--src/Blocks/BlockRedstoneRepeater.h25
1 files changed, 24 insertions, 1 deletions
diff --git a/src/Blocks/BlockRedstoneRepeater.h b/src/Blocks/BlockRedstoneRepeater.h
index 1eb67f714..e8262dc40 100644
--- a/src/Blocks/BlockRedstoneRepeater.h
+++ b/src/Blocks/BlockRedstoneRepeater.h
@@ -5,6 +5,7 @@
#include "Chunk.h"
#include "MetaRotator.h"
#include "ChunkInterface.h"
+#include "BlockSlab.h"
@@ -44,6 +45,7 @@ public:
}
+
virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
{
// Reset meta to zero
@@ -59,7 +61,28 @@ public:
virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override
{
- return ((a_RelY > 0) && cBlockInfo::IsSolid(a_Chunk.GetBlock(a_RelX, a_RelY - 1, a_RelZ)));
+ 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;
}