Refractor numerical folder
๐ Description
Clean up the numerical folder
๐ฏ Goals
- Appese Qodana
- Make variables final where possible
- Use final case
- Removed duplicated stuff (ShockVector is SpringVector, but for NaturalCamera)
โ Non Goals
Rewrite rendering/blending
๐ฆ Testing
Builds, functions in testing
โฎ๏ธ Backwards Compatibility
Yes
๐ Related Issues & Documents
#617
๐ผ๏ธ Screenshots/Recordings
n/a
๐ Added to documentation?
- [ ] ๐ README.md
- [ ] ๐ Documentation
- [ ] ๐ Javadoc
- [ ] ๐ Comments
- [x] ๐ No documentation needed
Walkthrough
This PR refactors static fields in ClientValueRepo from camelCase to UPPER_SNAKE_CASE with _LERPED suffix, applies Lombok annotations for automated accessor generation in utility classes, consolidates ShockVector functionality into SpringVector, and removes the SynchronizedSimulator wrapper class.
Changes
| Cohort / File(s) | Summary |
|---|---|
ClientValueRepo refactoring and propagation src/main/java/com/paneedah/weaponlib/animation/ClientValueRepo.java, src/main/java/com/paneedah/mwc/asm/Interceptors.java, src/main/java/com/paneedah/weaponlib/ViewfinderModel.java, src/main/java/com/paneedah/weaponlib/WeaponRenderer.java, src/main/java/com/paneedah/weaponlib/animation/movement/WeaponRotationHandler.java |
Renames seven public static LerpedValue fields (strafe, forward, running, gunPow, scopeX, scopeY, slidePumpValue) to uppercase constants with _LERPED suffix. Updates all references across multiple files to use the new naming convention. |
Lombok integration for numerical types src/main/java/com/paneedah/weaponlib/numerical/RandomVector.java, src/main/java/com/paneedah/weaponlib/numerical/SpringValue.java |
Adds @Getter and @Setter annotations; removes manual accessor methods. RandomVector corrects typo from agressiveness to aggressiveness. SpringValue gains auto-generated setters for previously private fields. |
SpringVector refactoring and consolidation src/main/java/com/paneedah/weaponlib/numerical/SpringVector.java |
Replaces per-axis fields (x, y, z) with static constants (SPRING_X, SPRING_Y, SPRING_Z); changes constructor from parameterized to no-arg; adds configure() method. Reorients public methods to operate on new field structure. |
ShockVector removal and NaturalCamera migration src/main/java/com/paneedah/weaponlib/render/cam/ShockVector.java, src/main/java/com/paneedah/weaponlib/render/cam/NaturalCamera.java |
Deletes ShockVector class entirely. Updates NaturalCamera to use SpringVector instead, replacing applyForce() with addVelocity() and getShockVector() with getPosition(). |
SynchronizedSimulator removal src/main/java/com/paneedah/weaponlib/numerical/SynchronizedSimulator.java |
Deletes entire SynchronizedSimulator class, eliminating the time-slicing wrapper around ISimulator. |
Estimated code review effort
๐ฏ 3 (Moderate) | โฑ๏ธ ~25 minutes
- ClientValueRepo field propagation: Verify all seven field renames are applied consistently across five files; check for any missed references.
-
SpringVector architectural change: Confirm that consolidating
x,y,zintoSPRING_X/Y/Zconstants preserves all previous functionality and method signatures. -
NaturalCamera migration: Ensure the transition from
ShockVector.applyForce()toSpringVector.addVelocity()maintains equivalent physics behavior. -
Lombok correctness: Confirm generated accessors in
RandomVectorandSpringValueare compatible with existing call sites (especially setter foraggressivenesswith corrected spelling).
Suggested labels
Productivity
Suggested reviewers
- Desoroxxx
Pre-merge checks and finishing touches
โ Failed checks (1 warning, 1 inconclusive)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | โ ๏ธ Warning | Docstring coverage is 6.90% which is insufficient. The required threshold is 80.00%. | You can run @coderabbitai generate docstrings to improve docstring coverage. |
| Title check | โ Inconclusive | The PR title 'Refractor numerical folder' is partially related to the changeset but contains a typo ('Refractor' instead of 'Refactor') and is somewhat vague about the specific improvements made beyond folder organization. | Consider clarifying the title to describe the main refactoring objective, such as 'Refactor numerical classes to use final fields and upper-case constants' or fix the typo to 'Refactor numerical folder'. |
โ Passed checks (1 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description check | โ Passed | The PR description is well-related to the changeset, clearly outlining goals including making variables final, using uppercase naming conventions, and removing duplicate code (ShockVector). |
โจ Finishing touches
- [ ] ๐ Generate docstrings
๐งช Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
- [ ] Commit unit tests in branch
strubium/num
[!WARNING] There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.
๐ง ast-grep (0.40.0)
src/main/java/com/paneedah/weaponlib/WeaponRenderer.java
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 and usage tips.
@coderabbitai generate docstrings