fix(physics): allow climbing through open trapdoors above ladders#359
Open
Semleks wants to merge 1 commit into
Open
fix(physics): allow climbing through open trapdoors above ladders#359Semleks wants to merge 1 commit into
Semleks wants to merge 1 commit into
Conversation
The bot can now climb up through a trapdoor/hatch if it is open and aligned with the ladder underneath (same facing property).
adepierre
reviewed
Jul 8, 2026
adepierre
left a comment
Owner
There was a problem hiding this comment.
Thanks for the PR, I added a few comments
Unfortunately, the reason it was a todo is because I don't really want to base things in the physics on block names and string comparison. If mojang decides to add something like a "broken_ladder" or change things so iron trapdoors don't behave the same as wooden ones this kind of hardcoded comparison will be hard to track down in the physics code and maintain.
| // sqrt(front_vector.x� + front_vector.z�) to follow vanilla code | ||
| // it's equal to cos(pitch) (as -90�<=pitch<=90�, cos(pitch) >= 0.0) | ||
| // sqrt(front_vector.x� + front_vector.z�) to follow vanilla code | ||
| // it's equal to cos(pitch) (as -90�<=pitch<=90�, cos(pitch) >= 0.0) |
Owner
There was a problem hiding this comment.
You have some encoding issues similar to the ones in your other PR.
| // as the trapdoor then the trapdoor is a climbable block too | ||
| return feet_block != nullptr && feet_block->IsClimbable(); | ||
| if (feet_block != nullptr && feet_block->IsClimbable()) | ||
| return true; |
Owner
There was a problem hiding this comment.
The if body should be between {} to be consistent with the rest of the repo.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The bot can now climb up through a trapdoor/hatch if it is open and aligned with the ladder underneath (same facing property).
I tested manually on my Arch Linux and vanilla server 1.21.11. So, it's work!
1.mp4
2.mp4