From bc1e236d547479833cc4f8d8218064cbdb9dfc0d Mon Sep 17 00:00:00 2001 From: Tiger Wang Date: Mon, 18 Nov 2013 22:30:34 +0000 Subject: Redstone Megacommit [SEE DESC] + Updated BlockID - look for yourself * Improved button, repeater, lever, and comparator code -> simplification and splitting of some stuff from the redstone simulator file * Fixed buttons not breaking when in an invalid game state * Fixed QueueSetBlock -> improved (AGAIN) piston code + Rewrote redstone simulator Fixes: #57, #58, #205, and part of #131. Fixes FS issues: 281, 116, and 102 --- source/Blocks/BlockRedstoneRepeater.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'source/Blocks/BlockRedstoneRepeater.h') 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; + } + } } ; -- cgit v1.2.3