summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockLever.h
diff options
context:
space:
mode:
authornarroo <narroo@vt.edu>2014-03-24 03:11:01 +0100
committernarroo <narroo@vt.edu>2014-03-24 03:11:01 +0100
commit2343b0dfbe12f6db76de1b4ed03cd902975d77b3 (patch)
treed4e7ae6bf16ec620f6b9dda016a3918fee33f431 /src/Blocks/BlockLever.h
parentFixed missing comment terminator. (diff)
downloadcuberite-2343b0dfbe12f6db76de1b4ed03cd902975d77b3.tar
cuberite-2343b0dfbe12f6db76de1b4ed03cd902975d77b3.tar.gz
cuberite-2343b0dfbe12f6db76de1b4ed03cd902975d77b3.tar.bz2
cuberite-2343b0dfbe12f6db76de1b4ed03cd902975d77b3.tar.lz
cuberite-2343b0dfbe12f6db76de1b4ed03cd902975d77b3.tar.xz
cuberite-2343b0dfbe12f6db76de1b4ed03cd902975d77b3.tar.zst
cuberite-2343b0dfbe12f6db76de1b4ed03cd902975d77b3.zip
Diffstat (limited to '')
-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
+ }
+ }
} ;