Repository navigation
Treat waterlogged blocks with a solid top as floors - #5152
Merged
Merged
Conversation
canWalkOnBlockState checked isWater before SlabBlock, so a waterlogged top slab, whose full top face supports the player like its dry form, was only walkable as a water surface and rejected with air above. Falls onto one were discarded as impossible water landings, and assumeWalkOnWater blocked pillaring and parkour from one. Add isWaterloggedSolidTop and exempt such blocks from those water checks, so they are walked on and landed on, with fall damage, like their dry form. Water you can fall into is unchanged.
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.
A waterlogged (aka "wogged") top slab supports the player exactly like a dry one: its water stays below the full top face. So pathing should treat it similarly.
canWalkOnBlockStatechecksisWaterbeforeSlabBlock, so the slab is only walkable as a water surface.MovementDescendtreats a landing on it as a water landing, discarding the fall because of the slab collision.assumeWalkOnWater, pillaring and parkour starting from one are refused.This adds
MovementHelper.isWaterloggedSolidTop(wogged, with a sturdy top face) and exempts those blocks from the four water checks above. They are walked on and landed on just like their dry form, and fall damage still counts, because the water doesn't reach the player standing on top.Added
WaterloggedSolidTopTest.This supersedes #3326, which special-cases top slabs and stairs in
canWalkOnPositiononly. That PR doesn't cover fall landings, pillaring, or parkour, and it's for 1.17.1 (a bit stale).Note: I'm sending this along with 1-5 other PRs; all discoveries and fixes I've had on a local fork, from my own experiences (the joys and sorrows) of using Baritone over the past few years, but I've decided to finally get around to submitting some of the better self-contained fixes upstream.