diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2015-06-27 00:24:51 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2015-12-18 14:17:38 +0100 |
commit | 5b62c4c3145c08b093521e42c565922fa85de4ad (patch) | |
tree | dca8cbfe86aa27af174da21f6835a8fbbe83d248 /src/Blocks/BlockRedstoneRepeater.h | |
parent | Merge pull request #2770 from cuberite/RemoveChunkDataCollector (diff) | |
download | cuberite-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 '')
-rw-r--r-- | src/Blocks/BlockRedstoneRepeater.h | 36 |
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}; + } + } + } } ; |