diff options
author | worktycho <work.tycho@gmail.com> | 2014-03-30 16:17:35 +0200 |
---|---|---|
committer | worktycho <work.tycho@gmail.com> | 2014-03-30 16:17:35 +0200 |
commit | 5260146f3c5d26c5583a8034eb8b342218a836d7 (patch) | |
tree | df19e59ec8716ac98d0926826c3207348809d750 /src/Blocks | |
parent | cPrefab now uses a struct for block type definition in CharMap. (diff) | |
parent | Another curly (diff) | |
download | cuberite-5260146f3c5d26c5583a8034eb8b342218a836d7.tar cuberite-5260146f3c5d26c5583a8034eb8b342218a836d7.tar.gz cuberite-5260146f3c5d26c5583a8034eb8b342218a836d7.tar.bz2 cuberite-5260146f3c5d26c5583a8034eb8b342218a836d7.tar.lz cuberite-5260146f3c5d26c5583a8034eb8b342218a836d7.tar.xz cuberite-5260146f3c5d26c5583a8034eb8b342218a836d7.tar.zst cuberite-5260146f3c5d26c5583a8034eb8b342218a836d7.zip |
Diffstat (limited to 'src/Blocks')
-rw-r--r-- | src/Blocks/BlockHandler.cpp | 2 | ||||
-rw-r--r-- | src/Blocks/BlockLilypad.h | 28 |
2 files changed, 30 insertions, 0 deletions
diff --git a/src/Blocks/BlockHandler.cpp b/src/Blocks/BlockHandler.cpp index 4f74e2f45..7fd8c183c 100644 --- a/src/Blocks/BlockHandler.cpp +++ b/src/Blocks/BlockHandler.cpp @@ -41,6 +41,7 @@ #include "BlockIce.h" #include "BlockLadder.h" #include "BlockLeaves.h" +#include "BlockLilypad.h" #include "BlockNewLeaves.h" #include "BlockLever.h" #include "BlockMelon.h" @@ -142,6 +143,7 @@ cBlockHandler * cBlockHandler::CreateBlockHandler(BLOCKTYPE a_BlockType) case E_BLOCK_LAPIS_ORE: return new cBlockOreHandler (a_BlockType); case E_BLOCK_LAVA: return new cBlockLavaHandler (a_BlockType); case E_BLOCK_LEAVES: return new cBlockLeavesHandler (a_BlockType); + case E_BLOCK_LILY_PAD: return new cBlockLilypadHandler (a_BlockType); case E_BLOCK_LIT_FURNACE: return new cBlockFurnaceHandler (a_BlockType); case E_BLOCK_LOG: return new cBlockSidewaysHandler (a_BlockType); case E_BLOCK_MELON: return new cBlockMelonHandler (a_BlockType); diff --git a/src/Blocks/BlockLilypad.h b/src/Blocks/BlockLilypad.h new file mode 100644 index 000000000..2dd4ec768 --- /dev/null +++ b/src/Blocks/BlockLilypad.h @@ -0,0 +1,28 @@ + +#pragma once + +#include "BlockHandler.h" +#include "Entities/Pickup.h" + + + + +class cBlockLilypadHandler : + public cBlockHandler +{ +public: + cBlockLilypadHandler(BLOCKTYPE a_BlockType) + : cBlockHandler(a_BlockType) + { + } + + virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override + { + // Reset meta to zero + a_Pickups.push_back(cItem(E_BLOCK_LILY_PAD, 1, 0)); + } +}; + + + + |