-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block break progress improvement #6500
base: stable
Are you sure you want to change the base?
Block break progress improvement #6500
Conversation
Duplicates #5581 |
@GameParrot what's your source of information for the data in this PR? |
Haste speed modifier was from the wiki, mining fatigue speed modifier was found by testing (wiki numbers inaccurate) |
I'd test those thoroughly if I were you. The last guy that tried to do this in #5581 couldn't get them to fully match up, not with wiki sources and not by guesswork either. Even better if you can pull up an old BDS in IDA and find the code that handles this in vanilla. |
Haste and mining fatigue seem pretty much perfect from my testing (tested with both low and high levels) |
…/GameParrot/PocketMine-MP into block-break-progress-improvement
/** | ||
* Checks if the player is currently on the ground. This is more accurate than {@link Player::isOnGround()} but slower. | ||
*/ | ||
public function isActuallyOnGround() : bool{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Something like calculate or smth in the name can be better than this function combined with docs ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm not a fan of this naming either. Also, why do we actually need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I'm not a fan of this naming either. Also, why do we actually need this?
We need it because when using the normal is on ground method the break progress indicator is still too fast when jumping. What should it be renamed to?
@@ -869,7 +869,7 @@ static function() : void{ | |||
* Checks if the player is currently on the ground. This is more accurate than {@link Player::isOnGround()} but slower. | |||
*/ | |||
public function isActuallyOnGround() : bool{ | |||
$bb = $this->boundingBox->expandedCopy(0, 0.001, 0); | |||
$bb = $this->boundingBox->expandedCopy(-0.001, 0.001, -0.001); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change doesn't look related to the PR. Why would this be needed for ground calculation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes inaccurate progress at high x/z coordinates
Fixes block break progress being inaccurate when not on ground or swimming. Also fixes syncing block break speed with client.
Related issues & PRs
Changes
API changes
Added Player::isActuallyOnGround(), more accurate than Player::isOnGround() but slower.
Behavioural changes
Block breaking progress is now much closer to vanilla.
In-Game Testing
Before:
https://github.com/user-attachments/assets/22f50b6e-f994-4a17-8dfc-53df70a8d6eb
After:
https://github.com/user-attachments/assets/3341eaaf-2bbc-4ac1-ad35-39947e907080