diff options
author | Tycho <work.tycho+git@gmail.com> | 2014-03-01 19:04:50 +0100 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-03-01 19:04:50 +0100 |
commit | 65edffd5b04623dcd4cebbd1afb2575e98eee5db (patch) | |
tree | 50957f2fd3d6d81a3471a88539e6c1aad755fe90 /src/Blocks/BlockVine.h | |
parent | Merge branch 'master' into MetaRotate (diff) | |
download | cuberite-65edffd5b04623dcd4cebbd1afb2575e98eee5db.tar cuberite-65edffd5b04623dcd4cebbd1afb2575e98eee5db.tar.gz cuberite-65edffd5b04623dcd4cebbd1afb2575e98eee5db.tar.bz2 cuberite-65edffd5b04623dcd4cebbd1afb2575e98eee5db.tar.lz cuberite-65edffd5b04623dcd4cebbd1afb2575e98eee5db.tar.xz cuberite-65edffd5b04623dcd4cebbd1afb2575e98eee5db.tar.zst cuberite-65edffd5b04623dcd4cebbd1afb2575e98eee5db.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Blocks/BlockVine.h | 30 |
1 files changed, 3 insertions, 27 deletions
diff --git a/src/Blocks/BlockVine.h b/src/Blocks/BlockVine.h index ee7dcee8a..9e2105f67 100644 --- a/src/Blocks/BlockVine.h +++ b/src/Blocks/BlockVine.h @@ -2,17 +2,17 @@ #pragma once #include "BlockHandler.h" - +#include "MetaRotater.h" class cBlockVineHandler : - public cBlockHandler + public cMetaRotater<cBlockHandler,0xF,0x4,0x8,0x1,0x2,true> { public: cBlockVineHandler(BLOCKTYPE a_BlockType) - : cBlockHandler(a_BlockType) + : cMetaRotater<cBlockHandler,0xF,0x4,0x8,0x1,0x2,true>(a_BlockType) { } @@ -169,31 +169,7 @@ 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)); - } } ; |