diff options
author | bibo38 <bibo38@github.com> | 2015-11-01 20:36:54 +0100 |
---|---|---|
committer | bibo38 <bibo38@github.com> | 2015-11-07 17:23:02 +0100 |
commit | d92a92d78aae9617b973a142878ab7c038cf0d3d (patch) | |
tree | 4b4b742cd2e5d7785bd2b4c38a0f7e1a3db260f2 | |
parent | Merge pull request #2618 from Gargaj/deadmeansdead (diff) | |
download | cuberite-d92a92d78aae9617b973a142878ab7c038cf0d3d.tar cuberite-d92a92d78aae9617b973a142878ab7c038cf0d3d.tar.gz cuberite-d92a92d78aae9617b973a142878ab7c038cf0d3d.tar.bz2 cuberite-d92a92d78aae9617b973a142878ab7c038cf0d3d.tar.lz cuberite-d92a92d78aae9617b973a142878ab7c038cf0d3d.tar.xz cuberite-d92a92d78aae9617b973a142878ab7c038cf0d3d.tar.zst cuberite-d92a92d78aae9617b973a142878ab7c038cf0d3d.zip |
-rw-r--r-- | src/BlockInfo.cpp | 1 | ||||
-rw-r--r-- | src/Blocks/BlockHandler.cpp | 2 | ||||
-rw-r--r-- | src/Blocks/BlockSlime.h | 32 |
3 files changed, 35 insertions, 0 deletions
diff --git a/src/BlockInfo.cpp b/src/BlockInfo.cpp index 70ca38362..54f11158e 100644 --- a/src/BlockInfo.cpp +++ b/src/BlockInfo.cpp @@ -305,6 +305,7 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info) a_Info[E_BLOCK_RED_MUSHROOM ].m_OneHitDig = true; a_Info[E_BLOCK_REEDS ].m_OneHitDig = true; a_Info[E_BLOCK_SAPLING ].m_OneHitDig = true; + a_Info[E_BLOCK_SLIME_BLOCK ].m_OneHitDig = true; a_Info[E_BLOCK_TNT ].m_OneHitDig = true; a_Info[E_BLOCK_TALL_GRASS ].m_OneHitDig = true; a_Info[E_BLOCK_TORCH ].m_OneHitDig = true; diff --git a/src/Blocks/BlockHandler.cpp b/src/Blocks/BlockHandler.cpp index dab99e53d..bb479db53 100644 --- a/src/Blocks/BlockHandler.cpp +++ b/src/Blocks/BlockHandler.cpp @@ -72,6 +72,7 @@ #include "BlockSideways.h" #include "BlockSignPost.h" #include "BlockSlab.h" +#include "BlockSlime.h" #include "BlockSnow.h" #include "BlockStairs.h" #include "BlockStems.h" @@ -297,6 +298,7 @@ cBlockHandler * cBlockHandler::CreateBlockHandler(BLOCKTYPE a_BlockType) case E_BLOCK_SEA_LANTERN: return new cBlockSeaLanternHandler (a_BlockType); case E_BLOCK_SIGN_POST: return new cBlockSignPostHandler (a_BlockType); case E_BLOCK_SNOW: return new cBlockSnowHandler (a_BlockType); + case E_BLOCK_SLIME_BLOCK: return new cBlockSlimeHandler (a_BlockType); case E_BLOCK_SPRUCE_DOOR: return new cBlockDoorHandler (a_BlockType); case E_BLOCK_SPRUCE_FENCE_GATE: return new cBlockFenceGateHandler (a_BlockType); case E_BLOCK_SPRUCE_WOOD_STAIRS: return new cBlockStairsHandler (a_BlockType); diff --git a/src/Blocks/BlockSlime.h b/src/Blocks/BlockSlime.h new file mode 100644 index 000000000..e785a6a13 --- /dev/null +++ b/src/Blocks/BlockSlime.h @@ -0,0 +1,32 @@ +#pragma once + +#include "BlockHandler.h" + + + + + +class cBlockSlimeHandler : + public cBlockHandler +{ +public: + cBlockSlimeHandler(BLOCKTYPE a_BlockType) + : cBlockHandler(a_BlockType) + { + } + + virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override + { + a_Pickups.push_back(cItem(m_BlockType, 1, 0)); + } + + virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override + { + UNUSED(a_Meta); + return 1; + } +}; + + + + |