diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-08-20 23:47:10 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-08-20 23:47:10 +0200 |
commit | b35771ca0d7faa6572025f8e9e61007df498e14c (patch) | |
tree | 54e16d566010129f8d5213c98f5422df733d209a /source/Blocks | |
parent | Juggled piston code to prioritise block action (diff) | |
download | cuberite-b35771ca0d7faa6572025f8e9e61007df498e14c.tar cuberite-b35771ca0d7faa6572025f8e9e61007df498e14c.tar.gz cuberite-b35771ca0d7faa6572025f8e9e61007df498e14c.tar.bz2 cuberite-b35771ca0d7faa6572025f8e9e61007df498e14c.tar.lz cuberite-b35771ca0d7faa6572025f8e9e61007df498e14c.tar.xz cuberite-b35771ca0d7faa6572025f8e9e61007df498e14c.tar.zst cuberite-b35771ca0d7faa6572025f8e9e61007df498e14c.zip |
Diffstat (limited to 'source/Blocks')
-rw-r--r-- | source/Blocks/BlockCarpet.h | 12 | ||||
-rw-r--r-- | source/Blocks/BlockHandler.cpp | 1 |
2 files changed, 10 insertions, 3 deletions
diff --git a/source/Blocks/BlockCarpet.h b/source/Blocks/BlockCarpet.h index f70ff45b6..9ac998131 100644 --- a/source/Blocks/BlockCarpet.h +++ b/source/Blocks/BlockCarpet.h @@ -8,6 +8,8 @@ #pragma once +#include "BlockHandler.h" + @@ -16,7 +18,11 @@ class cBlockCarpetHandler : public cBlockHandler { public: - cBlockCarpetHandler(BLOCKTYPE a_BlockType); + cBlockCarpetHandler(BLOCKTYPE a_BlockType) + : cBlockHandler(a_BlockType) + { + } + virtual const char * GetStepSound(void) override { @@ -39,13 +45,13 @@ public: virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override { - a_Pickups.push_back(cItem(E_BLOCK_CARPET, a_BlockMeta)); + a_Pickups.push_back(cItem(E_BLOCK_CARPET, 1, a_BlockMeta)); } virtual bool CanBeAt(int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override { - return ((a_RelY > 0) && (a_Chunk.GetBlock(a_RelX, a_RelY - 1, a_RelZ) != E_BLOCK_AIR)); + return (a_RelY > 0) && (a_Chunk.GetBlock(a_RelX, a_RelY - 1, a_RelZ) != E_BLOCK_AIR); } } ; diff --git a/source/Blocks/BlockHandler.cpp b/source/Blocks/BlockHandler.cpp index 6584eeed4..0fa013058 100644 --- a/source/Blocks/BlockHandler.cpp +++ b/source/Blocks/BlockHandler.cpp @@ -104,6 +104,7 @@ cBlockHandler * cBlockHandler::CreateBlockHandler(BLOCKTYPE a_BlockType) case E_BLOCK_BROWN_MUSHROOM: return new cBlockMushroomHandler (a_BlockType); case E_BLOCK_CACTUS: return new cBlockCactusHandler (a_BlockType); case E_BLOCK_CARROTS: return new cBlockCropsHandler (a_BlockType); + case E_BLOCK_CARPET: return new cBlockCarpetHandler (a_BlockType); case E_BLOCK_CAULDRON: return new cBlockCauldronHandler (a_BlockType); case E_BLOCK_CHEST: return new cBlockChestHandler (a_BlockType); case E_BLOCK_COAL_ORE: return new cBlockOreHandler (a_BlockType); |