summaryrefslogtreecommitdiffstats
path: root/source/Player.h
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2013-07-28 11:30:54 +0200
committermadmaxoft <github@xoft.cz>2013-07-28 11:30:54 +0200
commitd3801c0296dd32f430a4074932bfabf27a8ade03 (patch)
tree529694175b56e5eac589277298796a095ef55560 /source/Player.h
parentUpdated Core to the latest version. (diff)
downloadcuberite-d3801c0296dd32f430a4074932bfabf27a8ade03.tar
cuberite-d3801c0296dd32f430a4074932bfabf27a8ade03.tar.gz
cuberite-d3801c0296dd32f430a4074932bfabf27a8ade03.tar.bz2
cuberite-d3801c0296dd32f430a4074932bfabf27a8ade03.tar.lz
cuberite-d3801c0296dd32f430a4074932bfabf27a8ade03.tar.xz
cuberite-d3801c0296dd32f430a4074932bfabf27a8ade03.tar.zst
cuberite-d3801c0296dd32f430a4074932bfabf27a8ade03.zip
Diffstat (limited to 'source/Player.h')
-rw-r--r--source/Player.h13
1 files changed, 12 insertions, 1 deletions
diff --git a/source/Player.h b/source/Player.h
index fed222157..69b0c3df1 100644
--- a/source/Player.h
+++ b/source/Player.h
@@ -73,7 +73,18 @@ public:
virtual void TeleportToCoords(double a_PosX, double a_PosY, double a_PosZ) override;
- eGameMode GetGameMode(void) const { return m_GameMode; } // tolua_export
+ /// Returns the current gamemode. Partly OBSOLETE, you should use IsGameModeXXX() functions wherever applicable
+ eGameMode GetGameMode(void) const { return m_GameMode; } // tolua_export
+
+ /// Returns true if the player is in Creative mode, either explicitly, or by inheriting from current world
+ bool IsGameModeCreative(void) const;
+
+ /// Returns true if the player is in Survival mode, either explicitly, or by inheriting from current world
+ bool IsGameModeSurvival(void) const;
+
+ /// Returns true if the player is in Adventure mode, either explicitly, or by inheriting from current world
+ bool IsGameModeAdventure(void) const;
+
std::string GetIP() { return m_IP; } // tolua_export
float GetLastBlockActionTime() { return m_LastBlockActionTime; } // tolua_export
int GetLastBlockActionCnt() { return m_LastBlockActionCnt; } // tolua_export