summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockLever.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-03-30 16:58:42 +0200
committerMattes D <github@xoft.cz>2014-03-30 16:58:42 +0200
commite474f40ac947aad8e208455a6fde8522c671eed9 (patch)
tree6b5678b1bcf0cb054668851145bb7ccf38038a4c /src/Blocks/BlockLever.h
parentMerge pull request #838 from mc-server/lilypads (diff)
parentAdded in MetaMirrorXY and MetaMirrorYZ to cBlockSignHandler. (diff)
downloadcuberite-e474f40ac947aad8e208455a6fde8522c671eed9.tar
cuberite-e474f40ac947aad8e208455a6fde8522c671eed9.tar.gz
cuberite-e474f40ac947aad8e208455a6fde8522c671eed9.tar.bz2
cuberite-e474f40ac947aad8e208455a6fde8522c671eed9.tar.lz
cuberite-e474f40ac947aad8e208455a6fde8522c671eed9.tar.xz
cuberite-e474f40ac947aad8e208455a6fde8522c671eed9.tar.zst
cuberite-e474f40ac947aad8e208455a6fde8522c671eed9.zip
Diffstat (limited to 'src/Blocks/BlockLever.h')
-rw-r--r--src/Blocks/BlockLever.h37
1 files changed, 34 insertions, 3 deletions
diff --git a/src/Blocks/BlockLever.h b/src/Blocks/BlockLever.h
index ef6e102cd..ad2ae29e5 100644
--- a/src/Blocks/BlockLever.h
+++ b/src/Blocks/BlockLever.h
@@ -1,17 +1,18 @@
#pragma once
#include "BlockHandler.h"
-
+#include "MetaRotator.h"
class cBlockLeverHandler :
- public cBlockHandler
+ public cMetaRotator<cBlockHandler, 0x07, 0x04, 0x02, 0x03, 0x01, false>
{
+ typedef cMetaRotator<cBlockHandler, 0x07, 0x04, 0x02, 0x03, 0x01, false> super;
public:
cBlockLeverHandler(BLOCKTYPE a_BlockType)
- : cBlockHandler(a_BlockType)
+ : cMetaRotator<cBlockHandler, 0x07, 0x04, 0x02, 0x03, 0x01, false>(a_BlockType)
{
}
@@ -104,6 +105,36 @@ public:
return (a_RelY > 0) && cBlockInfo::IsSolid(BlockIsOn);
}
+
+
+ virtual NIBBLETYPE MetaRotateCCW(NIBBLETYPE a_Meta) override
+ {
+ switch (a_Meta)
+ {
+ case 0x00: return 0x07; // Ceiling rotation
+ case 0x07: return 0x00;
+
+ case 0x05: return 0x06; // Ground rotation
+ case 0x06: return 0x05;
+
+ default: return super::MetaRotateCCW(a_Meta); // Wall Rotation
+ }
+ }
+
+
+ virtual NIBBLETYPE MetaRotateCW(NIBBLETYPE a_Meta) override
+ {
+ switch (a_Meta)
+ {
+ case 0x00: return 0x07; // Ceiling rotation
+ case 0x07: return 0x00;
+
+ case 0x05: return 0x06; // Ground rotation
+ case 0x06: return 0x05;
+
+ default: return super::MetaRotateCCW(a_Meta); // Wall Rotation
+ }
+ }
} ;