summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockRedstoneRepeater.h
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2015-06-27 00:24:51 +0200
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2015-12-18 14:17:38 +0100
commit5b62c4c3145c08b093521e42c565922fa85de4ad (patch)
treedca8cbfe86aa27af174da21f6835a8fbbe83d248 /src/Blocks/BlockRedstoneRepeater.h
parentMerge pull request #2770 from cuberite/RemoveChunkDataCollector (diff)
downloadcuberite-5b62c4c3145c08b093521e42c565922fa85de4ad.tar
cuberite-5b62c4c3145c08b093521e42c565922fa85de4ad.tar.gz
cuberite-5b62c4c3145c08b093521e42c565922fa85de4ad.tar.bz2
cuberite-5b62c4c3145c08b093521e42c565922fa85de4ad.tar.lz
cuberite-5b62c4c3145c08b093521e42c565922fa85de4ad.tar.xz
cuberite-5b62c4c3145c08b093521e42c565922fa85de4ad.tar.zst
cuberite-5b62c4c3145c08b093521e42c565922fa85de4ad.zip
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};
+ }
+ }
+ }
} ;