Skip to content

fix: stop planes exploding on the ground near blocks - #84

Merged
XxFran10xX merged 3 commits into
mainfrom
fix/plane-ground-hit-wall
Oct 27, 2026
Merged

XxFran10xX merged 3 commits into
mainfrom
fix/plane-ground-hit-wall

Conversation

@XxFran10xX

@XxFran10xX XxFran10xX commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Why

On Main (2026-10-27 18:37 UTC) North_Were's Monoplane exploded while taxiing on their own deck, about 3 blocks from a chest. Neither the hull nor the wings touched it. LiftController.checkHitWall exploded any winged or balloon vehicle with engine speed 0.3+ when:

  • a solid block was within half a block of its 5 × 1.875 × 5 hitbox, even on the ground;
  • or a block was one cell past that, because the loop rounded the far edges up (Math.ceil);
  • and it counted whole block cells, so a chest, slab or fence counted as a full cube.

What changes

  • On the ground the plane no longer explodes. Its hitbox's own block collision stops it. While a block is within reach on the ground it gets no lift. Without that, Dev showed a plane held at full throttle against a chest lifting straight up after ~2 s (lift follows throttle, not ground speed) and then crashing.
  • In flight it still crashes into what it hits. Only a block's real collision shape inside the contact zone counts: the hitbox widened by half a block on each side, from half a block above its floor to its top. Touching the zone's edge doesn't count.
  • The check never loads a chunk.

Flight behaviour, lift, landing and the CRASH/EXPLODE death types are otherwise unchanged.

Tested

  • mvn verify: 1,785 tests, 0 failures. 15 new tests and 1 updated one cover the ground halt, no lift-off while blocked, flying hits, the zone edges, real block shapes and unloaded chunks. LiftController has full line coverage. Locally the coverage gate still fails only on the Windows-skipped permission tests (VehicleRepository, TrackStore, three template loaders), the same as on main.
  • Dev (TFMCDev01), mineflayer pilot bot, Monoplane on a glass runway, same script before and after:
Scenario 2.17.0 (before) This branch
Chest beside the path, clear of the hitbox exploded (EXPLODE) passes it and takes off
Chest straight ahead exploded stops at the chest and stays, 12 s at full throttle
Rolls off the runway into a wall crashed (CRASH) crashed (CRASH)
No obstacle normal flight normal flight

Dev held 20.0 TPS throughout, with no "Can't keep up" and no VehicleFramework errors in the log.

Not tested: backing out after being stopped, balloons, and other planes (same check, other hitboxes).

🤖 Generated with Claude Code

XxFran10xX and others added 3 commits October 27, 2026 22:46
The wall check exploded any winged or balloon vehicle with engine speed 0.3+
when a solid block sat within half a block of its hitbox, on the ground too.
Rounding up also reached one more block on the east, south and upper sides.
A Monoplane taxiing past a chest on its own deck blew up on Main (2026-10-27).

- On the ground the vehicle no longer explodes; its hitbox's block collision
  halts it.
- In flight, only a block's real collision shape inside the contact zone
  counts, from half a block above the hitbox floor to its top; touching the
  edge does not.
- The check never loads a chunk.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Dev showed a Monoplane held at full throttle against a chest lifting straight
up after two seconds, because lift follows the throttle, not ground speed.
In the air with the chest inside its contact zone it then crashed. While the
wall check finds it on the ground against a block, it now gets no lift.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 558ab5d4-10d5-4a46-adc6-5a2083ab68cc
Commits

Reviewing files that changed from the base of the PR and between ff4c41e and cd8f84f.

Files selected for processing: 3
  • src/main/java/net/tfminecraft/vehicleframework/vehicles/controller/LiftController.java
  • src/test/java/net/tfminecraft/vehicleframework/vehicles/controller/LiftControllerHitWallTest.java
  • src/test/java/net/tfminecraft/vehicleframework/vehicles/controller/VehicleMovementControllerCoverageTest.java

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Ground vehicles now stop receiving lift while obstructed and recover when the obstruction clears.
    • Collision detection now follows block shapes more accurately, avoids loading unloaded chunks, and prevents ground vehicles from being destroyed on contact.
    • Flying vehicles and other eligible vehicles retain their existing wall-collision handling.

LiftController now checks block collision shapes within a defined contact zone. Ground vehicles with an obstruction do not receive wing lift. Other eligible vehicles are destroyed on contact.

Changes: Lift collision handling

Layer / File(s) Summary
Contact-zone collision lookup
src/main/java/net/tfminecraft/vehicleframework/vehicles/controller/LiftController.java
The controller defines a contact zone and checks loaded, non-passable blocks for overlapping collision boxes.
State-based collision response and lift
src/main/java/net/tfminecraft/vehicleframework/vehicles/controller/LiftController.java, src/test/java/net/tfminecraft/vehicleframework/vehicles/controller/LiftControllerHitWallTest.java, src/test/java/net/tfminecraft/vehicleframework/vehicles/controller/VehicleMovementControllerCoverageTest.java
A blocked ground vehicle receives no wing lift. Other eligible vehicles are destroyed on contact. Tests cover these outcomes, collision-zone boundaries, collision shapes, passable blocks and unloaded chunks.

Priority: Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Sequence Diagram(s)

sequenceDiagram
  participant LiftController
  participant World
  participant Vehicle
  LiftController->>World: Check chunk state and block collision boxes
  World-->>LiftController: Return collision boxes
  alt Vehicle is in GROUND state
    LiftController->>LiftController: Mark groundBlocked and suppress wing lift
  else Other eligible vehicle
    LiftController->>Vehicle: Destroy with EXPLODE
  end
Loading

Suggested reviewers: ryanbarlow97

Merge Risk: Minimal · up to cd8f8

No identified issue currently blocks merging the ground-collision change; complete the normal checks before merging.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the size:M 30-99 effective changed lines (tests excluded in mixed PRs). label Oct 27, 2026
@XxFran10xX
XxFran10xX marked this pull request as ready for review October 27, 2026 22:23
@XxFran10xX

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@XxFran10xX
XxFran10xX merged commit 2f6d268 into main Oct 27, 2026
4 checks passed
@XxFran10xX
XxFran10xX deleted the fix/plane-ground-hit-wall branch October 27, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 effective changed lines (tests excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant