summaryrefslogtreecommitdiffstats
path: root/source/Blocks/BlockRedstoneRepeater.h
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2013-11-19 10:12:23 +0100
committerMattes D <github@xoft.cz>2013-11-19 10:12:23 +0100
commit208f2397f416ecdc790713a13bc5055c0ac43f0f (patch)
tree4ca8e0abb22275856c09c0e20e55b623ed057da2 /source/Blocks/BlockRedstoneRepeater.h
parentMerge branch 'master' of git://github.com/nesco/MCServer. (diff)
parentPossible compile fix (diff)
downloadcuberite-208f2397f416ecdc790713a13bc5055c0ac43f0f.tar
cuberite-208f2397f416ecdc790713a13bc5055c0ac43f0f.tar.gz
cuberite-208f2397f416ecdc790713a13bc5055c0ac43f0f.tar.bz2
cuberite-208f2397f416ecdc790713a13bc5055c0ac43f0f.tar.lz
cuberite-208f2397f416ecdc790713a13bc5055c0ac43f0f.tar.xz
cuberite-208f2397f416ecdc790713a13bc5055c0ac43f0f.tar.zst
cuberite-208f2397f416ecdc790713a13bc5055c0ac43f0f.zip
Diffstat (limited to 'source/Blocks/BlockRedstoneRepeater.h')
-rw-r--r--source/Blocks/BlockRedstoneRepeater.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/source/Blocks/BlockRedstoneRepeater.h b/source/Blocks/BlockRedstoneRepeater.h
index 958841a34..a61121d3a 100644
--- a/source/Blocks/BlockRedstoneRepeater.h
+++ b/source/Blocks/BlockRedstoneRepeater.h
@@ -48,6 +48,33 @@ public:
{
return "step.wood";
}
+
+
+ inline static NIBBLETYPE RepeaterRotationToMetaData(double a_Rotation)
+ {
+ a_Rotation += 90 + 45; // So its not aligned with axis
+ if (a_Rotation > 360)
+ {
+ a_Rotation -= 360;
+ }
+
+ if ((a_Rotation >= 0) && (a_Rotation < 90))
+ {
+ return 0x1;
+ }
+ else if ((a_Rotation >= 180) && (a_Rotation < 270))
+ {
+ return 0x3;
+ }
+ else if ((a_Rotation >= 90) && (a_Rotation < 180))
+ {
+ return 0x2;
+ }
+ else
+ {
+ return 0x0;
+ }
+ }
} ;