summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.h
diff options
context:
space:
mode:
authorKingCol13 <48412633+KingCol13@users.noreply.github.com>2020-10-02 22:57:17 +0200
committerGitHub <noreply@github.com>2020-10-02 22:57:17 +0200
commitcd1b50774512e09736b78df025163ab9b26bd528 (patch)
tree082bbf03758f8fe6e32711fbbf2104efdcb13994 /src/Entities/Player.h
parentUpdate issue templates (#4960) (diff)
downloadcuberite-cd1b50774512e09736b78df025163ab9b26bd528.tar
cuberite-cd1b50774512e09736b78df025163ab9b26bd528.tar.gz
cuberite-cd1b50774512e09736b78df025163ab9b26bd528.tar.bz2
cuberite-cd1b50774512e09736b78df025163ab9b26bd528.tar.lz
cuberite-cd1b50774512e09736b78df025163ab9b26bd528.tar.xz
cuberite-cd1b50774512e09736b78df025163ab9b26bd528.tar.zst
cuberite-cd1b50774512e09736b78df025163ab9b26bd528.zip
Diffstat (limited to 'src/Entities/Player.h')
-rw-r--r--src/Entities/Player.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/src/Entities/Player.h b/src/Entities/Player.h
index 568929f44..791b583bd 100644
--- a/src/Entities/Player.h
+++ b/src/Entities/Player.h
@@ -597,11 +597,17 @@ 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);
+ /** Returns the progress mined per tick for the block a_Block as a fraction
+ (1 would be completely mined)
+ Depends on hardness values so check those are correct.
+ Source: https://minecraft.gamepedia.com/Breaking#Calculation */
+ float GetMiningProgressPerTick(BLOCKTYPE a_Block);
+
+ /** Given tool, enchantments, status effects, and world position
+ returns whether a_Block would be instantly mined.
+ Depends on hardness values so check those are correct.
+ Source: https://minecraft.gamepedia.com/Breaking#Instant_breaking */
+ bool CanInstantlyMine(BLOCKTYPE a_Block);
/** get player explosion exposure rate */
virtual float GetExplosionExposureRate(Vector3d a_ExplosionPosition, float a_ExlosionPower) override;
@@ -805,8 +811,9 @@ private:
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. */
+ In he is in water it gets divided by 5 except if his tool is enchanted with aqua affinity.
+ If he is not on ground it also gets divided by 5.
+ Source: https://minecraft.gamepedia.com/Breaking#Calculation */
float GetDigSpeed(BLOCKTYPE a_Block);
/** Add the recipe Id to the known recipes.