Skip to content

fix: use expandTowards for elytra collision swept volume#5052

Open
CompileRider wants to merge 1 commit into
cabaletta:1.19.4from
CompileRider:fix/elytra-collision-expandTowards
Open

fix: use expandTowards for elytra collision swept volume#5052
CompileRider wants to merge 1 commit into
cabaletta:1.19.4from
CompileRider:fix/elytra-collision-expandTowards

Conversation

@CompileRider

Copy link
Copy Markdown
Contributor

Replace hitbox.inflate(motion.x, motion.y, motion.z) with hitbox.expandTowards(motion.x, motion.y, motion.z) in ElytraBehavior.simulate() to create a directional swept volume that prevents tunneling through 1-block-thick obstacles at high flight speeds.

expandTowards handles negative motion vectors correctly (unlike inflate which collapses the AABB) and provides full swept volume coverage (unlike move which only checks the destination hitbox).

Fixes #5049
Regression test for #5047

UwU

Replace hitbox.inflate(motion.x, motion.y, motion.z) with
hitbox.expandTowards(motion.x, motion.y, motion.z) in
ElytraBehavior.simulate() to create a directional swept volume
that prevents tunneling through 1-block-thick obstacles at
high flight speeds.

expandTowards handles negative motion vectors correctly (unlike
inflate which collapses the AABB) and provides full swept volume
coverage (unlike move which only checks the destination hitbox).

Fixes cabaletta#5049
Regression test for cabaletta#5047
@CompileRider CompileRider force-pushed the fix/elytra-collision-expandTowards branch from a42d953 to 35862c8 Compare June 10, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve Elytra collision detection: Use expandTowards to prevent tunneling at high speeds

1 participant