diff options
author | Lukas Pioch <lukas@zgow.de> | 2017-03-22 11:04:32 +0100 |
---|---|---|
committer | Lukas Pioch <lukas@zgow.de> | 2017-04-06 11:14:27 +0200 |
commit | 36dea62662c6b1f6e72f7a1e1fb16a34157fffe4 (patch) | |
tree | 959f32d31db464e7d097e3a0747821d9b53ebbe2 /src/Blocks/BlockBigFlower.h | |
parent | API: Removed function GetChar (#3664) (diff) | |
download | cuberite-36dea62662c6b1f6e72f7a1e1fb16a34157fffe4.tar cuberite-36dea62662c6b1f6e72f7a1e1fb16a34157fffe4.tar.gz cuberite-36dea62662c6b1f6e72f7a1e1fb16a34157fffe4.tar.bz2 cuberite-36dea62662c6b1f6e72f7a1e1fb16a34157fffe4.tar.lz cuberite-36dea62662c6b1f6e72f7a1e1fb16a34157fffe4.tar.xz cuberite-36dea62662c6b1f6e72f7a1e1fb16a34157fffe4.tar.zst cuberite-36dea62662c6b1f6e72f7a1e1fb16a34157fffe4.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Blocks/BlockBigFlower.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/Blocks/BlockBigFlower.h b/src/Blocks/BlockBigFlower.h index 64b2f0714..fe7f47b71 100644 --- a/src/Blocks/BlockBigFlower.h +++ b/src/Blocks/BlockBigFlower.h @@ -18,6 +18,11 @@ public: { } + virtual bool DoesIgnoreBuildCollision(cPlayer * a_Player, NIBBLETYPE a_Meta) override + { + return (((a_Meta & E_META_BIG_FLOWER_DOUBLE_TALL_GRASS) != 0) || (a_Meta & E_META_BIG_FLOWER_LARGE_FERN) != 0); + } + virtual void DropBlock(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cBlockPluginInterface & a_BlockPluginInterface, cEntity * a_Digger, int a_BlockX, int a_BlockY, int a_BlockZ, bool a_CanDrop) override { NIBBLETYPE Meta = a_ChunkInterface.GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ); @@ -54,7 +59,13 @@ public: NIBBLETYPE FlowerMeta = Meta & 0x7; if (!a_Player->IsGameModeCreative()) { - if (((FlowerMeta == 2) || (FlowerMeta == 3)) && (a_Player->GetEquippedItem().m_ItemType == E_ITEM_SHEARS)) + if ( + (a_Player->GetEquippedItem().m_ItemType == E_ITEM_SHEARS) && + ( + (FlowerMeta == E_META_BIG_FLOWER_DOUBLE_TALL_GRASS) || + (FlowerMeta == E_META_BIG_FLOWER_LARGE_FERN) + ) + ) { MTRand r1; if (r1.randInt(10) == 5) @@ -73,6 +84,17 @@ public: a_Player->UseEquippedItem(); } } + + if ( + (a_Player->GetEquippedItem().m_ItemType != E_ITEM_SHEARS) && + ( + (FlowerMeta == E_META_BIG_FLOWER_DOUBLE_TALL_GRASS) || + (FlowerMeta == E_META_BIG_FLOWER_LARGE_FERN) + ) + ) + { + a_ChunkInterface.SetBlock(a_BlockX, a_BlockY, a_BlockZ, 0, 0); + } } bool IsMetaTopPart(NIBBLETYPE a_Meta) |