summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockSign.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/BlockSign.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 '')
-rw-r--r--src/Blocks/BlockSign.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/Blocks/BlockSign.h b/src/Blocks/BlockSign.h
index cd0c02a40..6c0becfd6 100644
--- a/src/Blocks/BlockSign.h
+++ b/src/Blocks/BlockSign.h
@@ -71,6 +71,37 @@ public:
{
a_Player->GetClientHandle()->SendEditSign(a_BlockX, a_BlockY, a_BlockZ);
}
+
+
+ virtual NIBBLETYPE MetaRotateCW(NIBBLETYPE a_Meta) override
+ {
+ return (++a_Meta) & 0x0F;
+ }
+
+
+ virtual NIBBLETYPE MetaRotateCCW(NIBBLETYPE a_Meta) override
+ {
+ return (--a_Meta) & 0x0F;
+ }
+
+ virtual NIBBLETYPE MetaMirrorXY(NIBBLETYPE a_Meta) override
+ {
+ // Mirrors signs over the XY plane (North-South Mirroring)
+
+ // There are 16 meta values which correspond to different directions.
+ // These values are equated to angles on a circle; 0x08 = 180 degrees.
+ return (a_Meta < 0x08) ? 0x08 + a_Meta : 0x08 - a_Meta;
+ }
+
+
+ virtual NIBBLETYPE MetaMirrorYZ(NIBBLETYPE a_Meta) override
+ {
+ // Mirrors signs over the YZ plane (East-West Mirroring)
+
+ // There are 16 meta values which correspond to different directions.
+ // These values are equated to angles on a circle; 0x10 = 360 degrees.
+ return 0x10 - a_Meta;
+ }
} ;