summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockRedstoneRepeater.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Blocks/BlockRedstoneRepeater.h')
-rw-r--r--src/Blocks/BlockRedstoneRepeater.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/Blocks/BlockRedstoneRepeater.h b/src/Blocks/BlockRedstoneRepeater.h
index 5f413e10a..033ba82de 100644
--- a/src/Blocks/BlockRedstoneRepeater.h
+++ b/src/Blocks/BlockRedstoneRepeater.h
@@ -110,6 +110,42 @@ public:
UNUSED(a_Meta);
return 11;
}
+
+
+ inline static Vector3i GetRearCoordinateOffset(NIBBLETYPE a_Meta)
+ {
+ switch (a_Meta & 0x3) // We only want the direction (bottom) bits
+ {
+ case 0x0: return {0, 0, 1};
+ case 0x1: return {-1, 0, 0};
+ case 0x2: return {0, 0, -1};
+ case 0x3: return {1, 0, 0};
+ default:
+ {
+ LOGWARNING("%s: Unknown metadata: %d", __FUNCTION__, a_Meta);
+ ASSERT(!"Unknown metadata while determining orientation of repeater!");
+ return {0, 0, 0};
+ }
+ }
+ }
+
+
+ inline static Vector3i GetFrontCoordinateOffset(NIBBLETYPE a_Meta)
+ {
+ switch (a_Meta & 0x3) // We only want the direction (bottom) bits
+ {
+ case 0x0: return {0, 0, -1};
+ case 0x1: return {1, 0, 0};
+ case 0x2: return {0, 0, 1};
+ case 0x3: return {-1, 0, 0};
+ default:
+ {
+ LOGWARNING("%s: Unknown metadata: %d", __FUNCTION__, a_Meta);
+ ASSERT(!"Unknown metadata while determining orientation of repeater!");
+ return {0, 0, 0};
+ }
+ }
+ }
} ;