diff options
author | Ethan Jones <ethan@yasfu.net> | 2021-10-03 22:29:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-03 22:29:45 +0200 |
commit | afe07fe0900e5e03f439656558a953acf16f35b8 (patch) | |
tree | 1946a7980c5799bc4e028e78c6747102e4b92fba /src/Entities/HangingEntity.h | |
parent | Authenticator: avoid move assignments to self (#5315) (diff) | |
download | cuberite-afe07fe0900e5e03f439656558a953acf16f35b8.tar cuberite-afe07fe0900e5e03f439656558a953acf16f35b8.tar.gz cuberite-afe07fe0900e5e03f439656558a953acf16f35b8.tar.bz2 cuberite-afe07fe0900e5e03f439656558a953acf16f35b8.tar.lz cuberite-afe07fe0900e5e03f439656558a953acf16f35b8.tar.xz cuberite-afe07fe0900e5e03f439656558a953acf16f35b8.tar.zst cuberite-afe07fe0900e5e03f439656558a953acf16f35b8.zip |
Diffstat (limited to 'src/Entities/HangingEntity.h')
-rw-r--r-- | src/Entities/HangingEntity.h | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/src/Entities/HangingEntity.h b/src/Entities/HangingEntity.h index 2a15582be..dfed17dc5 100644 --- a/src/Entities/HangingEntity.h +++ b/src/Entities/HangingEntity.h @@ -21,10 +21,14 @@ public: // tolua_export cHangingEntity(eEntityType a_EntityType, eBlockFace a_BlockFace, Vector3d a_Pos); - // tolua_begin + /** Returns the direction in which the entity is facing. */ + eBlockFace GetFacing() const { return cHangingEntity::ProtocolFaceToBlockFace(m_Facing); } // tolua_export /** Returns the direction in which the entity is facing. */ - eBlockFace GetFacing() const { return cHangingEntity::ProtocolFaceToBlockFace(m_Facing); } + Byte GetProtocolFacing() const { return m_Facing; } + + /** Returns if the given block can support hanging entity placements. */ + static bool IsValidSupportBlock(BLOCKTYPE a_BlockType); // tolua_export /** Set the direction in which the entity is facing. */ void SetFacing(eBlockFace a_Facing) @@ -32,11 +36,6 @@ public: // tolua_export m_Facing = cHangingEntity::BlockFaceToProtocolFace(a_Facing); } - // tolua_end - - /** Returns the direction in which the entity is facing. */ - Byte GetProtocolFacing() const { return m_Facing; } - /** Set the direction in which the entity is facing. */ void SetProtocolFacing(Byte a_Facing) { @@ -48,14 +47,9 @@ protected: Byte m_Facing; - + virtual void KilledBy(TakeDamageInfo & a_TDI) override; virtual void SpawnOn(cClientHandle & a_ClientHandle) override; - virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override - { - UNUSED(a_Dt); - UNUSED(a_Chunk); - } - + virtual void Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk) override; /** Converts protocol hanging item facing to eBlockFace values */ inline static eBlockFace ProtocolFaceToBlockFace(Byte a_ProtocolFace) @@ -102,7 +96,3 @@ protected: UNREACHABLE("Unsupported block face"); } }; // tolua_export - - - - |