summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockPortal.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/BlockPortal.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/BlockPortal.h')
-rw-r--r--src/Blocks/BlockPortal.h48
1 files changed, 18 insertions, 30 deletions
diff --git a/src/Blocks/BlockPortal.h b/src/Blocks/BlockPortal.h
index 05daa9337..f704f2581 100644
--- a/src/Blocks/BlockPortal.h
+++ b/src/Blocks/BlockPortal.h
@@ -7,17 +7,14 @@
-class cBlockPortalHandler final :
- public cBlockHandler
+class cBlockPortalHandler final : public cBlockHandler
{
using Super = cBlockHandler;
-public:
-
+ public:
using Super::Super;
-private:
-
+ private:
virtual cItems ConvertToPickups(const NIBBLETYPE a_BlockMeta, const cItem * const a_Tool) const override
{
// No pickups
@@ -53,22 +50,20 @@ private:
{
if ((a_Position.y <= 0) || (a_Position.y >= cChunkDef::Height - 1))
{
- return false; // In case someone places a portal with meta 1 or 2 at boundaries, and server tries to get invalid coords at Y - 1 or Y + 1.
+ return false; // In case someone places a portal with meta 1 or 2 at boundaries, and server tries to get
+ // invalid coords at Y - 1 or Y + 1.
}
switch (a_Meta)
{
case 0x1:
{
- static const std::array<Vector3i, 4> PortalCheck
- {
- {
- { 0, 1, 0 },
- { 0, -1, 0 },
- { 1, 0, 0 },
- { -1, 0, 0 },
- }
- };
+ static const std::array<Vector3i, 4> PortalCheck {{
+ {0, 1, 0},
+ {0, -1, 0},
+ {1, 0, 0},
+ {-1, 0, 0},
+ }};
for (const auto & Direction : PortalCheck)
{
@@ -83,15 +78,12 @@ private:
}
case 0x2:
{
- static const std::array<Vector3i, 4> PortalCheck
- {
- {
- { 0, 1, 0 },
- { 0, -1, 0 },
- { 0, 0, -1 },
- { 0, 0, 1 },
- }
- };
+ static const std::array<Vector3i, 4> PortalCheck {{
+ {0, 1, 0},
+ {0, -1, 0},
+ {0, 0, -1},
+ {0, 0, 1},
+ }};
for (const auto & Direction : PortalCheck)
{
@@ -117,8 +109,4 @@ private:
UNUSED(a_Meta);
return 24;
}
-} ;
-
-
-
-
+};