Let ParCool see sub-levels - #1418
Open
BlackCube4 wants to merge 1 commit into
Open
Conversation
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.
None of its parkour moves function on a physics object today.
Wall-running, wall-jumping, vaulting and ledge grabs all fail.
Cause
Every wall, ledge and step ParCool looks for is found the same way: build a box around the player,
expand it toward a candidate surface, and ask whether anything is in the way.
There is no raycast anywhere in
WorldUtil- 31 probes across the class, every one of them aLevel#noCollisioncall.Sable makes collision work on a sub-level by redirecting the specific vanilla call sites that
matter -
Entity#collidewhile moving,Player#canFallAtLeast, and so on.Level#noCollisionitself is untouched, and
entity_sublevel_collision.LevelMixinonly carries the JOML sink. So amod that reaches for
noCollisiondirectly gets vanilla's answer: the world where the structureappears to be is empty air, the structure is invisible to it, and ParCool concludes there is no
wall to run along and no ledge to grab.
Strictly this is not a ParCool bug - any mod probing collision that way is blind to sub-levels in
the same manner.
Fix
compatibility/parcool/WorldUtilMixinredirects bothnoCollisionoverloads across the classthrough a sub-level check. It sits under
mixin.compatibility.parcool, soAbstractSableMixinPluginalready gates it on ParCool being loaded, and it needs no compiledependency on ParCool: every type in the redirected signatures is vanilla, so the mixin targets by
name.
Redirecting the whole class rather than a chosen method is deliberate. The actions share one blind
spot, and a per-action list would silently miss whatever ParCool adds next. Vanilla is still asked
first, so this can only ever turn a "clear" answer into an "occupied" one - it cannot invent a wall
that neither the level nor a sub-level has.
Why a new helper rather than
CanFallAtleastHelperThe geometry is deliberately the same -
Sable.HELPER.getAllIntersecting,transformInverseintothe sub-level's frame, then
OrientedBoundingBox3d.satper collision box - but the existing helperanswers a different question:
It grows the query box downward and drops its lower bound by a block so a fence post still counts
as ground underfoot. That is right for "is there anything to land on" and wrong for "is there a
wall here", where it would report a wall a metre above any floor. Hence
SubLevelNoCollisionHelperTesting
ParCool + Create Aeronautics, parkour actions enabled:
ordinary terrain after it.
One area I would welcome a second opinion on: the query box is transformed into the sub-level's
frame and tested with SAT, so a rotating or steeply banked structure is the interesting case
rather than a level one. If the probe boxes want tightening there,
SubLevelNoCollisionHelperkeeps them at full size, where
CanFallAtleastHelpershrinks its equivalent by0.1on X and Z.