summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.h
diff options
context:
space:
mode:
authorSTRWarrior <niels.breuker@hotmail.nl>2013-12-15 14:48:17 +0100
committerSTRWarrior <niels.breuker@hotmail.nl>2013-12-15 14:48:17 +0100
commitb10d0b95cbdce1d476f14415901c89bf324c0c18 (patch)
tree00aff412ae4fe7c691dc18f2fc3d6fd61dde8a60 /src/Entities/Player.h
parentMerge pull request #432 from mc-server/Broadcast_Effects (diff)
downloadcuberite-b10d0b95cbdce1d476f14415901c89bf324c0c18.tar
cuberite-b10d0b95cbdce1d476f14415901c89bf324c0c18.tar.gz
cuberite-b10d0b95cbdce1d476f14415901c89bf324c0c18.tar.bz2
cuberite-b10d0b95cbdce1d476f14415901c89bf324c0c18.tar.lz
cuberite-b10d0b95cbdce1d476f14415901c89bf324c0c18.tar.xz
cuberite-b10d0b95cbdce1d476f14415901c89bf324c0c18.tar.zst
cuberite-b10d0b95cbdce1d476f14415901c89bf324c0c18.zip
Diffstat (limited to '')
-rw-r--r--src/Entities/Player.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/Entities/Player.h b/src/Entities/Player.h
index 44cab7d74..f3ee841e7 100644
--- a/src/Entities/Player.h
+++ b/src/Entities/Player.h
@@ -250,6 +250,8 @@ public:
/// Returns true if the player is currently in the process of eating the currently equipped item
bool IsEating(void) const { return (m_EatingFinishTick >= 0); }
+ /// Returns true if the player is currently flying.
+ bool IsFlying(void) const { return m_IsFlying; }
// tolua_end
/// Starts eating the currently equipped item. Resets the eating timer and sends the proper animation packet
@@ -319,12 +321,20 @@ public:
/// Starts or stops sprinting, sends the max speed update to the client, if needed
void SetSprint(bool a_IsSprinting);
+ /// Flags the player as flying
+ void SetFlying(bool a_IsFlying);
+
+ /// If true the player can fly even when he's not in creative.
+ void SetCanFly(bool a_CanFly);
+
/// Returns whether the player is swimming or not
virtual bool IsSwimming(void) const{ return m_IsSwimming; }
/// Return whether the player is under water or not
virtual bool IsSubmerged(void) const{ return m_IsSubmerged; }
+ /// Returns wheter the player can fly or not.
+ virtual bool CanFly(void) const { return m_CanFly; }
// tolua_end
// cEntity overrides:
@@ -415,10 +425,12 @@ protected:
bool m_IsCrouched;
bool m_IsSprinting;
-
+ bool m_IsFlying;
bool m_IsSwimming;
bool m_IsSubmerged;
+ bool m_CanFly; // If this is true the player can fly. Even if he is not in creative.
+
/// The world tick in which eating will be finished. -1 if not eating
Int64 m_EatingFinishTick;