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/Entities/HangingEntity.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/Entities/HangingEntity.h')
-rw-r--r-- | src/Entities/HangingEntity.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/Entities/HangingEntity.h b/src/Entities/HangingEntity.h index a0e63d794..9cc7ee16b 100644 --- a/src/Entities/HangingEntity.h +++ b/src/Entities/HangingEntity.h @@ -8,15 +8,13 @@ // tolua_begin -class cHangingEntity : - public cEntity +class cHangingEntity : public cEntity { // tolua_end using Super = cEntity; -public: // tolua_export - + public: // tolua_export CLASS_PROTODEF(cHangingEntity) cHangingEntity(eEntityType a_EntityType, eBlockFace a_BlockFace, Vector3d a_Pos); @@ -30,8 +28,10 @@ public: // tolua_export /** Returns if the given block can support hanging entity placements. */ static bool IsValidSupportBlock(BLOCKTYPE a_BlockType); // tolua_export + // tolua_begin /** Set the direction in which the entity is facing. */ - void SetFacing(eBlockFace a_Facing) { m_Facing = cHangingEntity::BlockFaceToProtocolFace(a_Facing); } // tolua_export + void SetFacing(eBlockFace a_Facing) { m_Facing = cHangingEntity::BlockFaceToProtocolFace(a_Facing); } + // tolua_end /** Set the direction in which the entity is facing. */ void SetProtocolFacing(Byte a_Facing) @@ -40,8 +40,7 @@ public: // tolua_export m_Facing = a_Facing; } -protected: - + protected: Byte m_Facing; virtual void KilledBy(TakeDamageInfo & a_TDI) override; @@ -51,7 +50,8 @@ protected: /** Converts protocol hanging item facing to eBlockFace values */ inline static eBlockFace ProtocolFaceToBlockFace(Byte a_ProtocolFace) { - // The client uses different values for item frame directions and block faces. Our constants are for the block faces, so we convert them here to item frame faces + // The client uses different values for item frame directions and block faces. Our constants are for the block + // faces, so we convert them here to item frame faces switch (a_ProtocolFace) { case 0: return BLOCK_FACE_ZP; @@ -72,7 +72,8 @@ protected: /** Converts eBlockFace values to protocol hanging item faces */ inline static Byte BlockFaceToProtocolFace(eBlockFace a_BlockFace) { - // The client uses different values for item frame directions and block faces. Our constants are for the block faces, so we convert them here to item frame faces + // The client uses different values for item frame directions and block faces. Our constants are for the block + // faces, so we convert them here to item frame faces switch (a_BlockFace) { case BLOCK_FACE_ZP: return 0; |