summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockStems.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2019-10-16 10:06:34 +0200
committerGitHub <noreply@github.com>2019-10-16 10:06:34 +0200
commit221cc4ec5cb6301743e947eaabed3fecedba796f (patch)
tree4e44c8bb7523e5d1d04468fc906ae24674c10abc /src/Blocks/BlockStems.h
parentFixed crash in hopper while pulling items from blockentity above itself (#4412) (diff)
downloadcuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar.gz
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar.bz2
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar.lz
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar.xz
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.tar.zst
cuberite-221cc4ec5cb6301743e947eaabed3fecedba796f.zip
Diffstat (limited to 'src/Blocks/BlockStems.h')
-rw-r--r--src/Blocks/BlockStems.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/Blocks/BlockStems.h b/src/Blocks/BlockStems.h
index 659df558f..132526b93 100644
--- a/src/Blocks/BlockStems.h
+++ b/src/Blocks/BlockStems.h
@@ -8,21 +8,31 @@
class cBlockStemsHandler :
- public cBlockPlant
+ public cBlockPlant<true>
{
- typedef cBlockPlant Super;
+ using super = cBlockPlant<true>;
+
public:
- cBlockStemsHandler(BLOCKTYPE a_BlockType)
- : Super(a_BlockType, true)
+
+ cBlockStemsHandler(BLOCKTYPE a_BlockType):
+ super(a_BlockType)
{
}
- virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
+
+
+
+
+ virtual cItems ConvertToPickups(NIBBLETYPE a_BlockMeta, cBlockEntity * a_BlockEntity, const cEntity * a_Digger, const cItem * a_Tool) override
{
- short ItemType = (m_BlockType == E_BLOCK_MELON_STEM) ? E_ITEM_MELON_SEEDS : E_ITEM_PUMPKIN_SEEDS;
- a_Pickups.push_back(cItem(ItemType, 1, 0));
+ auto itemType = (m_BlockType == E_BLOCK_MELON_STEM) ? E_ITEM_MELON_SEEDS : E_ITEM_PUMPKIN_SEEDS;
+ return cItem(itemType, 1, 0);
}
+
+
+
+
virtual void OnUpdate(cChunkInterface & cChunkInterface, cWorldInterface & a_WorldInterface, cBlockPluginInterface & a_PluginInterface, cChunk & a_Chunk, int a_RelX, int a_RelY, int a_RelZ) override
{
auto Action = CanGrow(a_Chunk, a_RelX, a_RelY, a_RelZ);