diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-03-26 22:06:12 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-03-26 22:06:12 +0100 |
commit | 8dc54301a4f0c1d92d9775c3f97901acbf0230f6 (patch) | |
tree | c5c5fa436e823f7f49644b35f22249f46ecda5b9 /source/Blocks/BlockVine.h | |
parent | cBlockArea: Fixed type / meta copypasta errors in mirroring and rotation code (diff) | |
download | cuberite-8dc54301a4f0c1d92d9775c3f97901acbf0230f6.tar cuberite-8dc54301a4f0c1d92d9775c3f97901acbf0230f6.tar.gz cuberite-8dc54301a4f0c1d92d9775c3f97901acbf0230f6.tar.bz2 cuberite-8dc54301a4f0c1d92d9775c3f97901acbf0230f6.tar.lz cuberite-8dc54301a4f0c1d92d9775c3f97901acbf0230f6.tar.xz cuberite-8dc54301a4f0c1d92d9775c3f97901acbf0230f6.tar.zst cuberite-8dc54301a4f0c1d92d9775c3f97901acbf0230f6.zip |
Diffstat (limited to '')
-rw-r--r-- | source/Blocks/BlockVine.h | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/source/Blocks/BlockVine.h b/source/Blocks/BlockVine.h index 88338e86d..67376a4d8 100644 --- a/source/Blocks/BlockVine.h +++ b/source/Blocks/BlockVine.h @@ -138,10 +138,36 @@ public: }
- bool DoesDropOnUnsuitable(void)
+ virtual bool DoesDropOnUnsuitable(void) override
{
return false;
}
+
+
+ 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));
+ }
} ;
|