diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2015-06-30 16:50:15 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2015-07-14 22:46:30 +0200 |
commit | 8656e149c8820272a882406912790f0075ed5f28 (patch) | |
tree | b4f89f69dfb026f76862046637fd99162a49d3c9 /src/Blocks/BlockCarpet.h | |
parent | Merge pull request #2352 from mmdk95/master (diff) | |
download | cuberite-8656e149c8820272a882406912790f0075ed5f28.tar cuberite-8656e149c8820272a882406912790f0075ed5f28.tar.gz cuberite-8656e149c8820272a882406912790f0075ed5f28.tar.bz2 cuberite-8656e149c8820272a882406912790f0075ed5f28.tar.lz cuberite-8656e149c8820272a882406912790f0075ed5f28.tar.xz cuberite-8656e149c8820272a882406912790f0075ed5f28.tar.zst cuberite-8656e149c8820272a882406912790f0075ed5f28.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Blocks/BlockCarpet.h | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/src/Blocks/BlockCarpet.h b/src/Blocks/BlockCarpet.h index 4b287c664..19be882d0 100644 --- a/src/Blocks/BlockCarpet.h +++ b/src/Blocks/BlockCarpet.h @@ -23,7 +23,6 @@ public: { } - virtual bool GetPlacementBlockTypeMeta( cChunkInterface & a_ChunkInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, @@ -35,18 +34,44 @@ public: a_BlockMeta = a_Player->GetEquippedItem().m_ItemDamage & 0x0f; return true; } - virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override { a_Pickups.push_back(cItem(E_BLOCK_CARPET, 1, a_BlockMeta)); } - virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, 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); } + + virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override + { + switch (a_Meta) + { + case E_META_CARPET_WHITE: return 14; + case E_META_CARPET_ORANGE: return 15; + case E_META_CARPET_MAGENTA: return 16; + case E_META_CARPET_LIGHTBLUE: return 17; + case E_META_CARPET_YELLOW: return 18; + case E_META_CARPET_LIGHTGREEN: return 19; + case E_META_CARPET_PINK: return 20; + case E_META_CARPET_GRAY: return 21; + case E_META_CARPET_LIGHTGRAY: return 22; + case E_META_CARPET_CYAN: return 23; + case E_META_CARPET_PURPLE: return 24; + case E_META_CARPET_BLUE: return 25; + case E_META_CARPET_BROWN: return 26; + case E_META_CARPET_GREEN: return 27; + case E_META_CARPET_RED: return 28; + case E_META_CARPET_BLACK: return 29; + default: + { + ASSERT(!"Unhandled meta in carpet handler!"); + return 0; + } + } + } } ; |