summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockPlant.h
diff options
context:
space:
mode:
author0ddlyoko <nathangiaco@hotmail.com>2020-11-06 17:54:01 +0100
committerGitHub <noreply@github.com>2020-11-06 17:54:01 +0100
commit672bb0457012612ef59502b33717ee789c4d6bfe (patch)
tree962a76ff85b12a868009fa01659122386e695d0e /src/Blocks/BlockPlant.h
parentEnder Crytal Fix and report proper cmake file for luabindingscheck fail (#5017) (diff)
downloadcuberite-672bb0457012612ef59502b33717ee789c4d6bfe.tar
cuberite-672bb0457012612ef59502b33717ee789c4d6bfe.tar.gz
cuberite-672bb0457012612ef59502b33717ee789c4d6bfe.tar.bz2
cuberite-672bb0457012612ef59502b33717ee789c4d6bfe.tar.lz
cuberite-672bb0457012612ef59502b33717ee789c4d6bfe.tar.xz
cuberite-672bb0457012612ef59502b33717ee789c4d6bfe.tar.zst
cuberite-672bb0457012612ef59502b33717ee789c4d6bfe.zip
Diffstat (limited to 'src/Blocks/BlockPlant.h')
-rw-r--r--src/Blocks/BlockPlant.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/Blocks/BlockPlant.h b/src/Blocks/BlockPlant.h
index 71890b3cf..ab3f137a5 100644
--- a/src/Blocks/BlockPlant.h
+++ b/src/Blocks/BlockPlant.h
@@ -150,7 +150,10 @@ private:
{
case paGrowth:
{
- Grow(a_Chunk, a_RelPos);
+ if (Grow(a_Chunk, a_RelPos) == 0)
+ {
+ BearFruit(a_Chunk, a_RelPos);
+ }
break;
}
case paDeath:
@@ -161,4 +164,10 @@ private:
case paStay: break; // do nothing
}
}
+
+ /** Grows the final produce next to the stem at the specified position. */
+ virtual void BearFruit(cChunk & a_Chunk, const Vector3i a_StemRelPos) const
+ {
+ // Nothing to do by default
+ }
};