summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockRedstoneRepeater.h
diff options
context:
space:
mode:
authorAlexander Harkness <me@bearbin.net>2024-11-02 22:27:47 +0100
committerAlexander Harkness <me@bearbin.net>2024-11-02 22:27:47 +0100
commitcb50ec10591c0e0e4b9915e642bc50d3d8d1fd0a (patch)
treef647b20e1823f1846af88e832cf82a4a02e96e69 /src/Blocks/BlockRedstoneRepeater.h
parentImprove clang-format config file, remove automatically enforced code style from contrib guide. (diff)
downloadcuberite-clang-format-codebase.tar
cuberite-clang-format-codebase.tar.gz
cuberite-clang-format-codebase.tar.bz2
cuberite-clang-format-codebase.tar.lz
cuberite-clang-format-codebase.tar.xz
cuberite-clang-format-codebase.tar.zst
cuberite-clang-format-codebase.zip
Diffstat (limited to 'src/Blocks/BlockRedstoneRepeater.h')
-rw-r--r--src/Blocks/BlockRedstoneRepeater.h45
1 files changed, 16 insertions, 29 deletions
diff --git a/src/Blocks/BlockRedstoneRepeater.h b/src/Blocks/BlockRedstoneRepeater.h
index 893691d7b..ce0615e00 100644
--- a/src/Blocks/BlockRedstoneRepeater.h
+++ b/src/Blocks/BlockRedstoneRepeater.h
@@ -13,34 +13,29 @@
-class cBlockRedstoneRepeaterHandler final :
- public cYawRotator<cBlockHandler, 0x03, 0x00, 0x01, 0x02, 0x03>
+class cBlockRedstoneRepeaterHandler final : public cYawRotator<cBlockHandler, 0x03, 0x00, 0x01, 0x02, 0x03>
{
using Super = cYawRotator<cBlockHandler, 0x03, 0x00, 0x01, 0x02, 0x03>;
-public:
-
+ public:
using Super::Super;
- inline static Vector3i GetFrontCoordinateOffset(NIBBLETYPE a_Meta)
- {
- return -GetRearCoordinateOffset(a_Meta);
- }
+ inline static Vector3i GetFrontCoordinateOffset(NIBBLETYPE a_Meta) { return -GetRearCoordinateOffset(a_Meta); }
inline static Vector3i GetLeftCoordinateOffset(NIBBLETYPE a_Meta)
{
switch (a_Meta & E_META_REDSTONE_REPEATER_FACING_MASK) // We only want the direction (bottom) bits
{
- case E_META_REDSTONE_REPEATER_FACING_ZM: return { -1, 0, 0 };
- case E_META_REDSTONE_REPEATER_FACING_XP: return { 0, 0, -1 };
- case E_META_REDSTONE_REPEATER_FACING_ZP: return { 1, 0, 0 };
- case E_META_REDSTONE_REPEATER_FACING_XM: return { 0, 0, 1 };
+ case E_META_REDSTONE_REPEATER_FACING_ZM: return {-1, 0, 0};
+ case E_META_REDSTONE_REPEATER_FACING_XP: return {0, 0, -1};
+ case E_META_REDSTONE_REPEATER_FACING_ZP: return {1, 0, 0};
+ case E_META_REDSTONE_REPEATER_FACING_XM: return {0, 0, 1};
default:
{
LOGWARNING("%s: Unknown metadata: %d", __FUNCTION__, a_Meta);
ASSERT(!"Unknown metadata while determining orientation of repeater!");
- return { 0, 0, 0 };
+ return {0, 0, 0};
}
}
}
@@ -49,21 +44,20 @@ public:
{
switch (a_Meta & E_META_REDSTONE_REPEATER_FACING_MASK) // We only want the direction (bottom) bits
{
- case E_META_REDSTONE_REPEATER_FACING_ZM: return { 0, 0, 1 };
- case E_META_REDSTONE_REPEATER_FACING_XP: return { -1, 0, 0 };
- case E_META_REDSTONE_REPEATER_FACING_ZP: return { 0, 0, -1 };
- case E_META_REDSTONE_REPEATER_FACING_XM: return { 1, 0, 0 };
+ case E_META_REDSTONE_REPEATER_FACING_ZM: return {0, 0, 1};
+ case E_META_REDSTONE_REPEATER_FACING_XP: return {-1, 0, 0};
+ case E_META_REDSTONE_REPEATER_FACING_ZP: return {0, 0, -1};
+ case E_META_REDSTONE_REPEATER_FACING_XM: 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 };
+ return {0, 0, 0};
}
}
}
-private:
-
+ private:
virtual bool OnUse(
cChunkInterface & a_ChunkInterface,
cWorldInterface & a_WorldInterface,
@@ -98,10 +92,7 @@ private:
- virtual bool IsUseable(void) const override
- {
- return true;
- }
+ virtual bool IsUseable(void) const override { return true; }
@@ -156,8 +147,4 @@ private:
UNUSED(a_Meta);
return 11;
}
-} ;
-
-
-
-
+};