diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-03-10 19:36:55 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-03-10 19:36:55 +0100 |
commit | cc2d8052383d64ffe21e53a7ec401ed7ee345fcd (patch) | |
tree | 55571ea694182bf2c00f055a275be2df5ada703f /src/Blocks/BlockDropSpenser.h | |
parent | Shrapnel now configurable (diff) | |
parent | Fixed #778 - stack overflow.com (diff) | |
download | cuberite-cc2d8052383d64ffe21e53a7ec401ed7ee345fcd.tar cuberite-cc2d8052383d64ffe21e53a7ec401ed7ee345fcd.tar.gz cuberite-cc2d8052383d64ffe21e53a7ec401ed7ee345fcd.tar.bz2 cuberite-cc2d8052383d64ffe21e53a7ec401ed7ee345fcd.tar.lz cuberite-cc2d8052383d64ffe21e53a7ec401ed7ee345fcd.tar.xz cuberite-cc2d8052383d64ffe21e53a7ec401ed7ee345fcd.tar.zst cuberite-cc2d8052383d64ffe21e53a7ec401ed7ee345fcd.zip |
Diffstat (limited to 'src/Blocks/BlockDropSpenser.h')
-rw-r--r-- | src/Blocks/BlockDropSpenser.h | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/Blocks/BlockDropSpenser.h b/src/Blocks/BlockDropSpenser.h index 30d347ec9..7e0ad0e55 100644 --- a/src/Blocks/BlockDropSpenser.h +++ b/src/Blocks/BlockDropSpenser.h @@ -6,17 +6,18 @@ #pragma once #include "../Piston.h" +#include "MetaRotater.h" class cBlockDropSpenserHandler : - public cBlockEntityHandler + public cMetaRotater<cBlockEntityHandler, 0x07, 0x02, 0x05, 0x03, 0x04> { public: cBlockDropSpenserHandler(BLOCKTYPE a_BlockType) : - cBlockEntityHandler(a_BlockType) + cMetaRotater<cBlockEntityHandler, 0x07, 0x02, 0x05, 0x03, 0x04>(a_BlockType) { } @@ -34,6 +35,20 @@ public: a_BlockMeta = cPiston::RotationPitchToMetaData(a_Player->GetYaw(), a_Player->GetPitch()); return true; } + + virtual NIBBLETYPE MetaMirrorXZ(NIBBLETYPE a_Meta) override + { + // Bit 0x08 is a flag. Lowest three bits are position. 0x08 == 1000 + NIBBLETYPE OtherMeta = a_Meta & 0x08; + // Mirrors defined by by a table. (Source, mincraft.gamepedia.com) 0x07 == 0111 + switch (a_Meta & 0x07) + { + case 0x00: return 0x01 + OtherMeta; // Down -> Up + case 0x01: return 0x00 + OtherMeta; // Up -> Down + } + // Not Facing Up or Down; No change. + return a_Meta; + } } ; |