diff options
author | Alexander Harkness <me@bearbin.net> | 2024-11-02 22:27:47 +0100 |
---|---|---|
committer | Alexander Harkness <me@bearbin.net> | 2024-11-02 22:27:47 +0100 |
commit | cb50ec10591c0e0e4b9915e642bc50d3d8d1fd0a (patch) | |
tree | f647b20e1823f1846af88e832cf82a4a02e96e69 /src/Blocks/BlockSnow.h | |
parent | Improve clang-format config file, remove automatically enforced code style from contrib guide. (diff) | |
download | cuberite-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/BlockSnow.h')
-rw-r--r-- | src/Blocks/BlockSnow.h | 38 |
1 files changed, 17 insertions, 21 deletions
diff --git a/src/Blocks/BlockSnow.h b/src/Blocks/BlockSnow.h index f3fa87a1b..7e85ed907 100644 --- a/src/Blocks/BlockSnow.h +++ b/src/Blocks/BlockSnow.h @@ -7,24 +7,28 @@ -class cBlockSnowHandler final : - public cBlockHandler +class cBlockSnowHandler final : public cBlockHandler { using Super = cBlockHandler; -public: - + public: using Super::Super; -private: - + private: enum { FullBlockMeta = 7 // Meta value of a full-height snow block. }; - virtual bool DoesIgnoreBuildCollision(const cWorld & a_World, const cItem & a_HeldItem, const Vector3i a_Position, const NIBBLETYPE a_Meta, const eBlockFace a_ClickedBlockFace, const bool a_ClickedDirectly) const override + virtual bool DoesIgnoreBuildCollision( + const cWorld & a_World, + const cItem & a_HeldItem, + const Vector3i a_Position, + const NIBBLETYPE a_Meta, + const eBlockFace a_ClickedBlockFace, + const bool a_ClickedDirectly + ) const override { if (a_Meta == 0) { @@ -34,7 +38,9 @@ private: // Special case if a player is holding a (thin) snow block and its size can be increased: if ((a_HeldItem.m_ItemType == E_BLOCK_SNOW) && (a_Meta < FullBlockMeta)) { - return !a_ClickedDirectly || (a_ClickedBlockFace == BLOCK_FACE_YP); // If clicked an adjacent block, or clicked YP directly, we ignore collision. + return !a_ClickedDirectly || + (a_ClickedBlockFace == BLOCK_FACE_YP + ); // If clicked an adjacent block, or clicked YP directly, we ignore collision. } return false; @@ -99,23 +105,13 @@ private: } -private: - + private: /** Returns true if snow can be placed on top of a block with the given type and meta. */ static bool CanBeOn(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) { // If block below is snowable, or it is a thin snow block and is a full thin snow block, say yay: return ( - cBlockInfo::IsSnowable(a_BlockType) || - ( - (a_BlockType == E_BLOCK_SNOW) && - (a_BlockMeta == FullBlockMeta) - ) + cBlockInfo::IsSnowable(a_BlockType) || ((a_BlockType == E_BLOCK_SNOW) && (a_BlockMeta == FullBlockMeta)) ); } - -} ; - - - - +}; |