summaryrefslogtreecommitdiffstats
path: root/src/Blocks
diff options
context:
space:
mode:
authorAltenius <jacobjm18@gmail.com>2017-01-21 14:15:45 +0100
committerMattes D <github@xoft.cz>2017-01-28 13:55:38 +0100
commit0896b3b0790d368b5d8c9b4486fab184b825b0c8 (patch)
treeebb50ac1eabe439862aaac92dc73747a1079e67c /src/Blocks
parentChanged big flowers so they can only be placed on dirt (diff)
downloadcuberite-0896b3b0790d368b5d8c9b4486fab184b825b0c8.tar
cuberite-0896b3b0790d368b5d8c9b4486fab184b825b0c8.tar.gz
cuberite-0896b3b0790d368b5d8c9b4486fab184b825b0c8.tar.bz2
cuberite-0896b3b0790d368b5d8c9b4486fab184b825b0c8.tar.lz
cuberite-0896b3b0790d368b5d8c9b4486fab184b825b0c8.tar.xz
cuberite-0896b3b0790d368b5d8c9b4486fab184b825b0c8.tar.zst
cuberite-0896b3b0790d368b5d8c9b4486fab184b825b0c8.zip
Diffstat (limited to 'src/Blocks')
-rw-r--r--src/Blocks/BlockBigFlower.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/Blocks/BlockBigFlower.h b/src/Blocks/BlockBigFlower.h
index 449083c87..64b2f0714 100644
--- a/src/Blocks/BlockBigFlower.h
+++ b/src/Blocks/BlockBigFlower.h
@@ -75,12 +75,22 @@ public:
}
}
+ bool IsMetaTopPart(NIBBLETYPE a_Meta)
+ {
+ return (a_Meta & 0x08) != 0;
+ }
+
virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override
{
+ if (a_RelY <= 0)
+ {
+ return false;
+ }
BLOCKTYPE BlockType;
NIBBLETYPE BlockMeta;
a_Chunk.GetBlockTypeMeta(a_RelX, a_RelY - 1, a_RelZ, BlockType, BlockMeta);
- return ((a_RelY > 0) && (IsBlockTypeOfDirt(BlockType) || ((BlockType == E_BLOCK_BIG_FLOWER) && !(BlockMeta & 0x08))) && (a_RelY < cChunkDef::Height - 1) && ((a_Chunk.GetBlock(a_RelX, a_RelY + 1, a_RelZ) == E_BLOCK_AIR) || (a_Chunk.GetBlock(a_RelX, a_RelY + 1, a_RelZ) == E_BLOCK_BIG_FLOWER)));
+
+ return IsBlockTypeOfDirt(BlockType) || ((BlockType == E_BLOCK_BIG_FLOWER) && !IsMetaTopPart(BlockMeta));
}
virtual void OnDestroyed(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, int a_BlockX, int a_BlockY, int a_BlockZ) override