diff options
author | worktycho <work.tycho@gmail.com> | 2014-03-02 13:02:29 +0100 |
---|---|---|
committer | worktycho <work.tycho@gmail.com> | 2014-03-02 13:02:29 +0100 |
commit | 8990410f18a03ca553cca0103cd167bac06443cc (patch) | |
tree | acd72eb4208935762ad35a84af327bc3a921b6bf /src/Blocks/BlockVine.h | |
parent | Fixed errors (diff) | |
download | cuberite-8990410f18a03ca553cca0103cd167bac06443cc.tar cuberite-8990410f18a03ca553cca0103cd167bac06443cc.tar.gz cuberite-8990410f18a03ca553cca0103cd167bac06443cc.tar.bz2 cuberite-8990410f18a03ca553cca0103cd167bac06443cc.tar.lz cuberite-8990410f18a03ca553cca0103cd167bac06443cc.tar.xz cuberite-8990410f18a03ca553cca0103cd167bac06443cc.tar.zst cuberite-8990410f18a03ca553cca0103cd167bac06443cc.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Blocks/BlockVine.h | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/src/Blocks/BlockVine.h b/src/Blocks/BlockVine.h index 9e2105f67..b8213f29b 100644 --- a/src/Blocks/BlockVine.h +++ b/src/Blocks/BlockVine.h @@ -1,4 +1,3 @@ - #pragma once #include "BlockHandler.h" @@ -8,11 +7,11 @@ class cBlockVineHandler : - public cMetaRotater<cBlockHandler,0xF,0x4,0x8,0x1,0x2,true> + public cBlockHandler { public: cBlockVineHandler(BLOCKTYPE a_BlockType) - : cMetaRotater<cBlockHandler,0xF,0x4,0x8,0x1,0x2,true>(a_BlockType) + : cBlockHandler(a_BlockType) { } @@ -169,6 +168,31 @@ public: a_World->SetBlock(X, Y - 1, Z, E_BLOCK_VINES, a_World->GetBlockMeta(X, Y, Z)); } } + + virtual NIBBLETYPE MetaRotateCCW(NIBBLETYPE a_Meta) override + { + return ((a_Meta >> 1) | (a_Meta << 3)) & 0x0f; // Rotate bits to the right + } + + + virtual NIBBLETYPE MetaRotateCW(NIBBLETYPE a_Meta) override + { + return ((a_Meta << 1) | (a_Meta >> 3)) & 0x0f; // Rotate bits to the left + } + + + virtual NIBBLETYPE MetaMirrorXY(NIBBLETYPE a_Meta) override + { + // Bits 2 and 4 stay, bits 1 and 3 swap + return ((a_Meta & 0x0a) | ((a_Meta & 0x01) << 2) | ((a_Meta & 0x04) >> 2)); + } + + + virtual NIBBLETYPE MetaMirrorYZ(NIBBLETYPE a_Meta) override + { + // Bits 1 and 3 stay, bits 2 and 4 swap + return ((a_Meta & 0x05) | ((a_Meta & 0x02) << 2) | ((a_Meta & 0x08) >> 2)); + } } ; |