Repository navigation
fix: stop melee from wrecking vehicle weapons - #82
Conversation
Every weapon takes each hit on the vehicle in full and weapons had no melee modifier, so punches and sword hits on a parked airship wore every gun down ten times faster than the hull, which the armour templates give entity_attack 0.1. Weapons now default ENTITY_ATTACK to 0.1 unless their own damage list sets it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Default modifier and test src/main/java/net/tfminecraft/vehicleframework/weapons/Weapon.java, src/test/java/net/tfminecraft/vehicleframework/weapons/WeaponsCoverageTest.java |
Weapon defines MELEE_MODIFIER as 0.1 and applies it when no ENTITY_ATTACK modifier is configured. The test checks default damage handling and the value of an explicit entity_attack(1.0) modifier. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Suggested reviewers: ryanbarlow97
Merge Risk: 
Minimal · up to c66aa
-
The change addresses default melee damage handling without an identified merge-blocking risk.
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.
Comment @coderabbitai help to get the list of available commands.
|
@coderabbitai review |
✅ Action performed
|
Problem
Players reported that Behemoth and Cloudskimmer weapons drop to 0 after landing. Landing isn't the cause: a Dev bot test (51-block climb, then a controlled landing on VF 2.16.4) left every weapon and component at 0 damage, because FALL has been 0 for weapons since #74.
What does wreck them is melee.
ActiveVehicle.damagepasses each hit to every weapon in full. Weapons had noENTITY_ATTACKmodifier, but every armour template gives the hull, balloon and engineentity_attack: 0.1. In the same Dev test, 5 fist punches from an unmounted player took 5% off each of the Behemoth's 7 weapons and 0.5% off the hull and balloon. Main's data matches: a Behemoth that landed between 10-21 and 10-22 took 41.07 on every weapon and 4.107 on the hull.Change
ENTITY_ATTACKto 0.1, the same as the hull, unless their owndamage:list sets it (e.g.entity_attack(1.0)keeps the old behaviour).PROJECTILE/ROCKET) are unchanged.Tests
meleeHitsWeaponsLikeTheHullUnlessConfigured.mvn verifylocally: 1758 tests, 0 failures. Locally the coverage gate fails only on untouched classes whose tests skip on Windows (9 skipped);Weaponis fully covered.~/landing-dura-test/test.js): Behemoth and Cloudskimmer landing, then 5 punches from an unmounted player. Results are in the comments.🤖 Generated with Claude Code