-
-
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
Open
GameParrot
wants to merge
15
commits into
pmmp:stable
Choose a base branch
from
GameParrot:block-break-progress-improvement
base: stable
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+50
−4
Open
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
7e0f680
Improve block break progress
GameParrot 020b2d1
Fix CS
GameParrot 38b2fbb
Fix more CS
GameParrot 9f9878c
fix phpstan
GameParrot 54b1b94
Merge branch 'stable' into block-break-progress-improvement
GameParrot 7e5b903
Use getEffectLevel instead of getAmplifier
GameParrot 0cadd69
Fix insta break check
GameParrot dd7b333
Merge branch 'block-break-progress-improvement' of https://github.com…
GameParrot 36a3094
Merge branch 'stable' into block-break-progress-improvement
GameParrot be17d67
Merge branch 'stable' into block-break-progress-improvement
GameParrot ab5342c
Merge branch 'stable' into block-break-progress-improvement
GameParrot 7128f27
Merge branch 'stable' into block-break-progress-improvement
GameParrot dc89118
Merge branch 'stable' into block-break-progress-improvement
GameParrot 72a69dc
Merge branch 'stable' into block-break-progress-improvement
GameParrot b51b9e3
Fix floating point issue at high x/z coordinates
GameParrot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -865,6 +865,29 @@ static function() : void{ | |
Timings::$playerChunkSend->stopTiming(); | ||
} | ||
|
||
/** | ||
* 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.001, 0.001, -0.001); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Fixes inaccurate progress at high x/z coordinates |
||
$maxY = (int) floor($this->location->y); | ||
$minY = $maxY - 1; | ||
$floorMinX = (int) floor($bb->minX); | ||
$floorMinZ = (int) floor($bb->minZ); | ||
$floorMaxX = (int) floor($bb->maxX); | ||
$floorMaxZ = (int) floor($bb->maxZ); | ||
for ($x = $floorMinX ; $x <= $floorMaxX ; $x++){ | ||
for ($y = $minY ; $y <= $maxY ; $y++){ | ||
for ($z = $floorMinZ ; $z <= $floorMaxZ ; $z++){ | ||
if ($this->getWorld()->getBlockAt($x, $y, $z)->collidesWithBB($bb)){ | ||
return true; | ||
} | ||
} | ||
} | ||
} | ||
return false; | ||
} | ||
|
||
private function recheckBroadcastPermissions() : void{ | ||
foreach([ | ||
DefaultPermissionNames::BROADCAST_ADMIN => Server::BROADCAST_CHANNEL_ADMINISTRATIVE, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
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?