summaryrefslogtreecommitdiffstats
path: root/src/Blocks
diff options
context:
space:
mode:
authorLukas Pioch <lukas@zgow.de>2017-03-22 11:04:32 +0100
committerLukas Pioch <lukas@zgow.de>2017-04-06 11:14:27 +0200
commit36dea62662c6b1f6e72f7a1e1fb16a34157fffe4 (patch)
tree959f32d31db464e7d097e3a0747821d9b53ebbe2 /src/Blocks
parentAPI: Removed function GetChar (#3664) (diff)
downloadcuberite-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 'src/Blocks')
-rw-r--r--src/Blocks/BlockBigFlower.h24
-rw-r--r--src/Blocks/BlockDeadBush.h5
2 files changed, 28 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)
diff --git a/src/Blocks/BlockDeadBush.h b/src/Blocks/BlockDeadBush.h
index 9afa2d323..0e81d6c2f 100644
--- a/src/Blocks/BlockDeadBush.h
+++ b/src/Blocks/BlockDeadBush.h
@@ -17,6 +17,11 @@ public:
{
}
+ virtual bool DoesIgnoreBuildCollision(void) override
+ {
+ return true;
+ }
+
virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override
{
if (a_RelY <= 0)