Skip to content

fix: only warn about missing aim-vector on cursor weapons - #63

Merged
XxFran10xX merged 1 commit into
mainfrom
fix/quiet-aim-vector-fallback
Oct 8, 2026
Merged

XxFran10xX merged 1 commit into
mainfrom
fix/quiet-aim-vector-fallback

Conversation

@XxFran10xX

Copy link
Copy Markdown
Contributor

Summary

Main's console prints [VehicleFramework] Error! Weapon naval_gun has no aim-vector; falling back to first bones entry: exit.exitalign (and the same for aa_turret) each time a gunboat or AA-turret vehicle loads. On 2026-10-06 the logs had about 100 of these lines. The message is harmless: the fallback is the same bone, and only aim-mode: cursor weapons ever read the aim vector.

  • Code: WeaponMovementController still falls back to the first bones entry, but only cursor-aim weapons log the warning. That is the only case where a missing aim-vector affects behaviour.
  • Configs: the bundled vehicle files now set aim-vector explicitly to the first bones entry for all 30 movable weapons that had none (gunboat, sloop, cruiser, ironclad, behemoth, AA turret, anti-air, field/fixed artillery, cloudskimmer, biplane, bomber, gyrobomber). Fixed weapons (bomb bays, forward guns, torpedo launcher) are unchanged. Behaviour stays the same because the value matches the old fallback.
  • Test: a new test checks that a manual weapon falls back without a warning and a cursor weapon still logs one. Rig's VFLogger mock is now public so weapon tests can verify against it.

saveResource(..., false) does not overwrite existing files, so live servers need the same aim-vector lines added by hand. Main's vehicle files match the repo defaults.

Testing

  • mvn clean verify locally on Windows: all tests pass. The line-coverage gate reports misses only in untouched file/database classes (VehicleRepository, TrackStore, template loaders), which look like Windows-only gaps. CI on Linux is the authority.
  • Loaded on TFMCDev01: see the PR comment.

🤖 Generated with Claude Code

@XxFran10xX

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 599357b5-5ced-4742-8ed3-0268e9d40de0

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 285ed7f7-e05e-40db-91ca-70fca6d6f215
📥 Commits

Reviewing files that changed from the base of the PR and between f5408b8 and 2e6c22a.

📒 Files selected for processing (16)
  • src/main/java/net/tfminecraft/vehicleframework/weapons/controller/WeaponMovementController.java
  • src/main/resources/vehicles/aa_turret.yml
  • src/main/resources/vehicles/anti_air.yml
  • src/main/resources/vehicles/behemoth.yml
  • src/main/resources/vehicles/biplane.yml
  • src/main/resources/vehicles/bomber.yml
  • src/main/resources/vehicles/cloudskimmer.yml
  • src/main/resources/vehicles/cruiser.yml
  • src/main/resources/vehicles/field_artillery.yml
  • src/main/resources/vehicles/fixed_artillery.yml
  • src/main/resources/vehicles/gunboat.yml
  • src/main/resources/vehicles/gyrobomber.yml
  • src/main/resources/vehicles/ironclad.yml
  • src/main/resources/vehicles/sloop.yml
  • src/test/java/net/tfminecraft/vehicleframework/projectiles/ProjectilesCoverageTest.java
  • src/test/java/net/tfminecraft/vehicleframework/weapons/WeaponsCoverageTest.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
    • Cannons, turrets and guns across a range of vehicles now aim using their configured alignment points, providing more consistent weapon direction.
    • Fallback warnings are now limited to cursor-aim weapons; other aim modes use the fallback without displaying a warning.

Walkthrough

Vehicle weapon configurations now specify aim vectors for their weapon exits. When aim-vector is not configured, the controller keeps the first bones entry as its fallback and logs a warning only for cursor-aim weapons.

Changes

Weapon aim configuration

Layer / File(s) Summary
Configure vehicle weapon aim vectors
src/main/resources/vehicles/*.yml
Weapon entries across the vehicle configurations now set aim-vector to the corresponding exit alignment bone.
Control fallback warning logging
src/main/java/net/tfminecraft/vehicleframework/weapons/controller/WeaponMovementController.java, src/test/java/net/tfminecraft/vehicleframework/weapons/WeaponsCoverageTest.java
The first configured bone remains the fallback when aim-vector is unset. The warning is logged only for cursor-aim weapons. The test checks both cursor and non-cursor cases.

Projectile test fixture

Layer / File(s) Summary
Expose the fixture logger
src/test/java/net/tfminecraft/vehicleframework/projectiles/ProjectilesCoverageTest.java
The Rig.logger field is now public. Its type and final modifier are unchanged.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: drefvelin

Merge Risk: ⚪ Minimal · up to 2e6c2

The vehicle weapons retain their previous aim behavior, while non-cursor weapons no longer emit the fallback warning. No actionable merge-blocking risk is evident.

  • Autopilot · 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.

@coderabbitai

coderabbitai Bot commented Oct 7, 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.

Manual-aim weapons never read the aim vector, so the fallback warning
was console noise every time a gunboat or AA turret loaded. Also set
aim-vector explicitly (same as the old fallback) on every movable
weapon in the bundled vehicle configs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@XxFran10xX
XxFran10xX force-pushed the fix/quiet-aim-vector-fallback branch from 2e6c22a to 7680ebb Compare October 8, 2026 11:37
@XxFran10xX

Copy link
Copy Markdown
Contributor Author

Dev (TFMCDev01) test, mineflayer bot spawning gunboat / aa_turret / sloop / gyrobomber:

  • PR jar + old configs: all 6 manual-aim weapons quiet; the 4 cursor-aim gyrobomber guns still warn (expected).
  • configs with aim-vector + vf reload / restart: all 10 weapons quiet, every vehicle spawns without errors.

@XxFran10xX
XxFran10xX merged commit 9bad61d into main Oct 8, 2026
2 checks passed
@XxFran10xX
XxFran10xX deleted the fix/quiet-aim-vector-fallback branch October 8, 2026 11:41
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.

1 participant