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/BlockFenceGate.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/BlockFenceGate.h | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/src/Blocks/BlockFenceGate.h b/src/Blocks/BlockFenceGate.h index b5c1323bd..81e93fa50 100644 --- a/src/Blocks/BlockFenceGate.h +++ b/src/Blocks/BlockFenceGate.h @@ -16,13 +16,11 @@ public: { } - virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override { a_Pickups.Add(m_BlockType, 1, 0); // Reset meta to zero } - virtual bool GetPlacementBlockTypeMeta( cChunkInterface & a_ChunkInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, @@ -35,7 +33,6 @@ public: return true; } - virtual void OnUse(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, int a_CursorX, int a_CursorY, int a_CursorZ) override { NIBBLETYPE OldMetaData = a_ChunkInterface.GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ); @@ -55,20 +52,17 @@ public: a_Player->GetWorld()->BroadcastSoundParticleEffect(1003, a_BlockX, a_BlockY, a_BlockZ, 0, a_Player->GetClientHandle()); } - virtual void OnCancelRightClick(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace) override { a_WorldInterface.SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, a_Player); } - virtual bool IsUseable(void) override { return true; } - - /// Converts the player's yaw to placed gate's blockmeta + /** Converts the player's yaw to placed gate's blockmeta */ inline static NIBBLETYPE PlayerYawToMetaData(double a_Yaw) { ASSERT((a_Yaw >= -180) && (a_Yaw < 180)); @@ -95,6 +89,25 @@ public: return 0x3; } } + + virtual ColourID GetMapBaseColourID(NIBBLETYPE a_Meta) override + { + UNUSED(a_Meta); + switch (m_BlockType) + { + case E_BLOCK_OAK_FENCE_GATE: return 13; + case E_BLOCK_SPRUCE_FENCE_GATE: return 34; + case E_BLOCK_BIRCH_FENCE_GATE: return 2; + case E_BLOCK_JUNGLE_FENCE_GATE: return 10; + case E_BLOCK_DARK_OAK_FENCE_GATE: return 26; + case E_BLOCK_ACACIA_FENCE_GATE: return 15; + default: + { + ASSERT(!"Unhandled blocktype in fence gate handler!"); + return 0; + } + } + } } ; |