diff options
author | Howaner <franzi.moos@googlemail.com> | 2014-09-02 19:12:35 +0200 |
---|---|---|
committer | Howaner <franzi.moos@googlemail.com> | 2014-09-02 19:12:35 +0200 |
commit | 1bb4d7941267ee55cdf7f35fa6a0055521115960 (patch) | |
tree | 38b2faa2d824bca6da9ec88c2c0c0d9bbe81f6df /src/Entities/Player.h | |
parent | Added name tag (diff) | |
download | cuberite-1bb4d7941267ee55cdf7f35fa6a0055521115960.tar cuberite-1bb4d7941267ee55cdf7f35fa6a0055521115960.tar.gz cuberite-1bb4d7941267ee55cdf7f35fa6a0055521115960.tar.bz2 cuberite-1bb4d7941267ee55cdf7f35fa6a0055521115960.tar.lz cuberite-1bb4d7941267ee55cdf7f35fa6a0055521115960.tar.xz cuberite-1bb4d7941267ee55cdf7f35fa6a0055521115960.tar.zst cuberite-1bb4d7941267ee55cdf7f35fa6a0055521115960.zip |
Diffstat (limited to 'src/Entities/Player.h')
-rw-r--r-- | src/Entities/Player.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/Entities/Player.h b/src/Entities/Player.h index 9821cc6d9..da64bd64f 100644 --- a/src/Entities/Player.h +++ b/src/Entities/Player.h @@ -251,6 +251,9 @@ public: The returned value either is empty, or includes the cChatColor::Delimiter. */ AString GetColor(void) const; + /** Returns the name that is used in the tablist. */ + AString GetTabListName(void) const; + /** tosses the item in the selected hotbar slot */ void TossEquippedItem(char a_Amount = 1); @@ -398,6 +401,16 @@ public: /** If true the player can fly even when he's not in creative. */ void SetCanFly(bool a_CanFly); + /** Is a custom name for this player set? */ + bool HasCustomName(void) const { return !m_CustomName.empty(); } + + /** Returns the custom name of this player. If the player hasn't a custom name, it will return an empty string. */ + const AString & GetCustomName(void) const { return m_CustomName; } + + /** Sets the custom name of this player. If you want to disable the custom name, simply set an empty string. + The custom name will be used in the tab-list, in the player nametag and in the tab-completion. */ + void SetCustomName(const AString & a_CustomName); + /** Gets the last position that the player slept in This is initialised to the world spawn point if the player has not slept in a bed as of yet */ @@ -562,6 +575,8 @@ protected: If no ClientHandle is given, the UUID is initialized to empty. */ AString m_UUID; + AString m_CustomName; + /** Sets the speed and sends it to the client, so that they are forced to move so. */ virtual void DoSetSpeed(double a_SpeedX, double a_SpeedY, double a_SpeedZ) override; |