summaryrefslogtreecommitdiffstats
path: root/source/Player.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-07-28 19:15:03 +0200
committermadmaxoft <github@xoft.cz>2013-07-28 19:15:03 +0200
commit4746d2251c6204118e710c818d78b89c356a7427 (patch)
tree2573e0b5e70b04aebc35d5da034c8449ff696f3d /source/Player.h
parentProtoProxy now properly waits for both sides to establish encryption (diff)
downloadcuberite-4746d2251c6204118e710c818d78b89c356a7427.tar
cuberite-4746d2251c6204118e710c818d78b89c356a7427.tar.gz
cuberite-4746d2251c6204118e710c818d78b89c356a7427.tar.bz2
cuberite-4746d2251c6204118e710c818d78b89c356a7427.tar.lz
cuberite-4746d2251c6204118e710c818d78b89c356a7427.tar.xz
cuberite-4746d2251c6204118e710c818d78b89c356a7427.tar.zst
cuberite-4746d2251c6204118e710c818d78b89c356a7427.zip
Diffstat (limited to 'source/Player.h')
-rw-r--r--source/Player.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/Player.h b/source/Player.h
index 69b0c3df1..093c35b44 100644
--- a/source/Player.h
+++ b/source/Player.h
@@ -28,6 +28,7 @@ public:
{
MAX_HEALTH = 20,
MAX_FOOD_LEVEL = 20,
+ EATING_TICKS = 30, ///< Number of ticks it takes to eat an item
} ;
// tolua_end
@@ -164,6 +165,15 @@ public:
// tolua_end
+ /// Starts eating the currently equipped item. Resets the eating timer and sends the proper animation packet
+ void StartEating(void);
+
+ /// Finishes eating the currently equipped item. Consumes the item, updates health and broadcasts the packets
+ void FinishEating(void);
+
+ /// Aborts the current eating operation
+ void AbortEating(void);
+
virtual void KilledBy(cEntity * a_Killer) override;
void Respawn(void); // tolua_export
@@ -296,6 +306,9 @@ protected:
bool m_IsCrouched;
bool m_IsSprinting;
+ /// The world tick in which eating will be finished. -1 if not eating
+ Int64 m_EatingFinishTick;
+
virtual void Destroyed(void);