summaryrefslogtreecommitdiffstats
path: root/src/Items/ItemLadder.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/Items/ItemLadder.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/Items/ItemLadder.h')
-rw-r--r--src/Items/ItemLadder.h22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/Items/ItemLadder.h b/src/Items/ItemLadder.h
index a778fee6c..a8e73961e 100644
--- a/src/Items/ItemLadder.h
+++ b/src/Items/ItemLadder.h
@@ -8,17 +8,14 @@
-class cItemLadderHandler final :
- public cItemHandler
+class cItemLadderHandler final : public cItemHandler
{
using Super = cItemHandler;
-public:
-
+ public:
using Super::Super;
-private:
-
+ private:
/** Converts the block face of the neighbor to which the ladder is attached to the ladder block's meta. */
static NIBBLETYPE BlockFaceToMetaData(eBlockFace a_NeighborBlockFace)
{
@@ -30,12 +27,18 @@ private:
case BLOCK_FACE_XP: return 0x5;
case BLOCK_FACE_YM:
case BLOCK_FACE_YP: return 0x2;
- default: UNREACHABLE("Unsupported neighbor block face");
+ default: UNREACHABLE("Unsupported neighbor block face");
}
}
- virtual bool CommitPlacement(cPlayer & a_Player, const cItem & a_HeldItem, const Vector3i a_PlacePosition, eBlockFace a_ClickedBlockFace, const Vector3i a_CursorPosition) const override
+ virtual bool CommitPlacement(
+ cPlayer & a_Player,
+ const cItem & a_HeldItem,
+ const Vector3i a_PlacePosition,
+ eBlockFace a_ClickedBlockFace,
+ const Vector3i a_CursorPosition
+ ) const override
{
const auto & World = *a_Player.GetWorld();
const auto ClickedBlockType = World.GetBlock(AddFaceDirection(a_PlacePosition, a_ClickedBlockFace, true));
@@ -60,7 +63,8 @@ private:
Returns BLOCK_FACE_NONE on failure. */
static eBlockFace FindSuitableFace(const cWorld & a_World, const Vector3i a_Position)
{
- for (const auto Face : { BLOCK_FACE_ZM, BLOCK_FACE_XP, BLOCK_FACE_ZP, BLOCK_FACE_XM }) // Loop through all faces in specific order.
+ for (const auto Face :
+ {BLOCK_FACE_ZM, BLOCK_FACE_XP, BLOCK_FACE_ZP, BLOCK_FACE_XM}) // Loop through all faces in specific order.
{
// The direction of Face is relative to the direction the ladder faces.
// This is the position, computed inverted, that such a ladder would attach to.