diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-11-18 23:30:34 +0100 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-11-18 23:30:34 +0100 |
commit | bc1e236d547479833cc4f8d8218064cbdb9dfc0d (patch) | |
tree | 8b40bc3a6d5a7b6828d72095afc7c8dfbf5137d5 /source/Blocks/BlockRedstoneRepeater.h | |
parent | Mineshafts: silenced a compiler warning. (diff) | |
download | cuberite-bc1e236d547479833cc4f8d8218064cbdb9dfc0d.tar cuberite-bc1e236d547479833cc4f8d8218064cbdb9dfc0d.tar.gz cuberite-bc1e236d547479833cc4f8d8218064cbdb9dfc0d.tar.bz2 cuberite-bc1e236d547479833cc4f8d8218064cbdb9dfc0d.tar.lz cuberite-bc1e236d547479833cc4f8d8218064cbdb9dfc0d.tar.xz cuberite-bc1e236d547479833cc4f8d8218064cbdb9dfc0d.tar.zst cuberite-bc1e236d547479833cc4f8d8218064cbdb9dfc0d.zip |
Diffstat (limited to 'source/Blocks/BlockRedstoneRepeater.h')
-rw-r--r-- | source/Blocks/BlockRedstoneRepeater.h | 27 |
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; + } + } } ; |