summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockDropSpenser.h
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-02-27 20:33:35 +0100
committerTycho <work.tycho+git@gmail.com>2014-02-27 20:33:35 +0100
commit84913299f45a28d3bd6146b3decbf14764449030 (patch)
tree02707f55323bb35f4d0de65a376ba10e3a1fb5e4 /src/Blocks/BlockDropSpenser.h
parentFixed crash and some warnings in map handling. (diff)
downloadcuberite-84913299f45a28d3bd6146b3decbf14764449030.tar
cuberite-84913299f45a28d3bd6146b3decbf14764449030.tar.gz
cuberite-84913299f45a28d3bd6146b3decbf14764449030.tar.bz2
cuberite-84913299f45a28d3bd6146b3decbf14764449030.tar.lz
cuberite-84913299f45a28d3bd6146b3decbf14764449030.tar.xz
cuberite-84913299f45a28d3bd6146b3decbf14764449030.tar.zst
cuberite-84913299f45a28d3bd6146b3decbf14764449030.zip
Diffstat (limited to '')
-rw-r--r--src/Blocks/BlockDropSpenser.h18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/Blocks/BlockDropSpenser.h b/src/Blocks/BlockDropSpenser.h
index 30d347ec9..2253fcd1b 100644
--- a/src/Blocks/BlockDropSpenser.h
+++ b/src/Blocks/BlockDropSpenser.h
@@ -12,11 +12,11 @@
class cBlockDropSpenserHandler :
- public cBlockEntityHandler
+ public cMetaRotater<cBlockEntityHandler,0x07,0x02,0x05,0x03,0x04>
{
public:
cBlockDropSpenserHandler(BLOCKTYPE a_BlockType) :
- cBlockEntityHandler(a_BlockType)
+ cMetaRotater<cBlockEntitHandler,0x07,0x02,0x05,0x03,0x04>(a_BlockType)
{
}
@@ -34,6 +34,20 @@ public:
a_BlockMeta = cPiston::RotationPitchToMetaData(a_Player->GetYaw(), a_Player->GetPitch());
return true;
}
+
+ virtual NIBBLETYPE MetaMirrorXZ(NIBBLETYPE a_Meta) override
+ {
+ // Bit 0x08 is a flag. Lowest three bits are position. 0x08 == 1000
+ NIBBLETYPE OtherMeta = a_Meta & 0x08;
+ // Mirrors defined by by a table. (Source, mincraft.gamepedia.com) 0x07 == 0111
+ switch (a_Meta & 0x07)
+ {
+ case 0x00: return 0x01 + OtherMeta; // Down -> Up
+ case 0x01: return 0x00 + OtherMeta; // Up -> Down
+ }
+ // Not Facing Up or Down; No change.
+ return a_Meta;
+ }
} ;