summaryrefslogtreecommitdiffstats
path: root/source/Player.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-07-07 16:13:43 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-07-07 16:13:43 +0200
commit0224a4f7fc17400dd100a2333c7bbf9c898426c4 (patch)
tree5b909dc5b57a6859334591e0c5295547d8e9061f /source/Player.h
parentImproved function names for protocol packet sending; alpha-sorted the function lists (diff)
downloadcuberite-0224a4f7fc17400dd100a2333c7bbf9c898426c4.tar
cuberite-0224a4f7fc17400dd100a2333c7bbf9c898426c4.tar.gz
cuberite-0224a4f7fc17400dd100a2333c7bbf9c898426c4.tar.bz2
cuberite-0224a4f7fc17400dd100a2333c7bbf9c898426c4.tar.lz
cuberite-0224a4f7fc17400dd100a2333c7bbf9c898426c4.tar.xz
cuberite-0224a4f7fc17400dd100a2333c7bbf9c898426c4.tar.zst
cuberite-0224a4f7fc17400dd100a2333c7bbf9c898426c4.zip
Diffstat (limited to '')
-rw-r--r--source/Player.h32
1 files changed, 31 insertions, 1 deletions
diff --git a/source/Player.h b/source/Player.h
index 639b2595b..ea293297a 100644
--- a/source/Player.h
+++ b/source/Player.h
@@ -171,11 +171,34 @@ public:
/// Returns the list of slots currently stored for inventory painting. To be used by cWindow only
const cSlotNums & GetInventoryPaintSlots(void) const;
+ // tolua_begin
+
+ /// Returns the current maximum speed, as reported in the 1.6.1+ protocol (takes current sprinting state into account)
+ double GetMaxSpeed(void) const;
+
+ /// Gets the normal maximum speed, as reported in the 1.6.1+ protocol, in the protocol units
+ double GetNormalMaxSpeed(void) const { return m_NormalMaxSpeed; }
+
+ /// Gets the sprinting maximum speed, as reported in the 1.6.1+ protocol, in the protocol units
+ double GetSprintingMaxSpeed(void) const { return m_SprintingMaxSpeed; }
+
+ /// Sets the normal maximum speed, as reported in the 1.6.1+ protocol. Sends the update to player, if needed.
+ void SetNormalMaxSpeed(double a_Speed);
+
+ /// Sets the sprinting maximum speed, as reported in the 1.6.1+ protocol. Sends the update to player, if needed.
+ void SetSprintingMaxSpeed(double a_Speed);
+
/// Sets the crouch status, broadcasts to all visible players
void SetCrouch(bool a_IsCrouched);
+ /// Starts or stops sprinting, sends the max speed update to the client, if needed
+ void SetSprint(bool a_IsSprinting);
+
+ // tolua_end
+
// cEntity overrides:
- virtual bool IsCrouched(void) const { return m_IsCrouched; }
+ virtual bool IsCrouched (void) const { return m_IsCrouched; }
+ virtual bool IsSprinting(void) const { return m_IsSprinting; }
protected:
typedef std::map< std::string, bool > PermissionMap;
@@ -226,7 +249,14 @@ protected:
cSlotNums m_InventoryPaintSlots;
+ /// Max speed, in ENTITY_PROPERTIES packet's units, when the player is walking. 0.1 by default
+ double m_NormalMaxSpeed;
+
+ /// Max speed, in ENTITY_PROPERTIES packet's units, when the player is sprinting. 0.13 by default
+ double m_SprintingMaxSpeed;
+
bool m_IsCrouched;
+ bool m_IsSprinting;
virtual void Destroyed(void);