diff options
author | mohe2015 <mohe2015@users.noreply.github.com> | 2016-11-06 19:30:19 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2016-11-06 19:30:19 +0100 |
commit | 32b38fb2649fb282b6446c4e544866c0161aa7da (patch) | |
tree | 51d2fd4d507b9f46e80d90f357a6fee78d2f5ffa /src/Entities/Player.h | |
parent | Merge pull request #3416 from cuberite/JsonSerializerErrorReport (diff) | |
download | cuberite-32b38fb2649fb282b6446c4e544866c0161aa7da.tar cuberite-32b38fb2649fb282b6446c4e544866c0161aa7da.tar.gz cuberite-32b38fb2649fb282b6446c4e544866c0161aa7da.tar.bz2 cuberite-32b38fb2649fb282b6446c4e544866c0161aa7da.tar.lz cuberite-32b38fb2649fb282b6446c4e544866c0161aa7da.tar.xz cuberite-32b38fb2649fb282b6446c4e544866c0161aa7da.tar.zst cuberite-32b38fb2649fb282b6446c4e544866c0161aa7da.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Entities/Player.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Entities/Player.h b/src/Entities/Player.h index cc83b1ca2..3de1a4cb5 100644 --- a/src/Entities/Player.h +++ b/src/Entities/Player.h @@ -529,6 +529,12 @@ public: The player removes its m_ClientHandle ownership so that the ClientHandle gets deleted. */ void RemoveClientHandle(void); + /** Returns the relative block hardness for the block a_Block. + The bigger it is the faster the player can break the block. + Returns zero if the block is instant breakable. + Otherwise it returns the dig speed (float GetDigSpeed(BLOCKTYPE a_Block)) divided by the block hardness (cBlockInfo::GetHardness(BLOCKTYPE a_Block)) divided by 30 if the player can harvest the block and divided by 100 if he can't. */ + float GetPlayerRelativeBlockHardness(BLOCKTYPE a_Block); + protected: typedef std::vector<std::vector<AString> > AStringVectorVector; @@ -710,4 +716,19 @@ private: /** Pins the player to a_Location until Unfreeze() is called. If ManuallyFrozen is false, the player will unfreeze when the chunk is loaded. */ void FreezeInternal(const Vector3d & a_Location, bool a_ManuallyFrozen); + + /** Returns how high the liquid is in percent. Used by IsInsideWater */ + float GetLiquidHeightPercent(NIBBLETYPE a_Meta); + + /** Checks if the player is inside of water */ + bool IsInsideWater(); + + /** Returns the dig speed using the current tool on the block a_Block. + Returns one if using hand. + If the player is using a tool that is good to break the block the value is higher. + If he has an enchanted tool with efficiency or he has a haste or mining fatique effect it gets multiplied by a specific factor depending on the strength of the effect or enchantment. + In he is in water it gets divided by 5 except his tool is enchanted with aqa affinity. + If he is not on ground it also gets divided by 5. */ + float GetDigSpeed(BLOCKTYPE a_Block); + } ; // tolua_export |