diff options
author | Tycho <work.tycho+git@gmail.com> | 2014-03-09 19:02:30 +0100 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-03-09 19:02:30 +0100 |
commit | b5e33c5424c0b148a7076bb0f3019cfb0ef9c824 (patch) | |
tree | dabb3041abd9b8513570111310903992254d8063 /src/Blocks/BlockDropSpenser.h | |
parent | Fix IsThread destructor (diff) | |
parent | Fixed #778 - stack overflow.com (diff) | |
download | cuberite-b5e33c5424c0b148a7076bb0f3019cfb0ef9c824.tar cuberite-b5e33c5424c0b148a7076bb0f3019cfb0ef9c824.tar.gz cuberite-b5e33c5424c0b148a7076bb0f3019cfb0ef9c824.tar.bz2 cuberite-b5e33c5424c0b148a7076bb0f3019cfb0ef9c824.tar.lz cuberite-b5e33c5424c0b148a7076bb0f3019cfb0ef9c824.tar.xz cuberite-b5e33c5424c0b148a7076bb0f3019cfb0ef9c824.tar.zst cuberite-b5e33c5424c0b148a7076bb0f3019cfb0ef9c824.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; + } } ; |