Modern-Warfare-Cubed icon indicating copy to clipboard operation
Modern-Warfare-Cubed copied to clipboard

Refractor numerical folder

Open strubium opened this issue 1 month ago โ€ข 1 comments

๐Ÿ“ 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

strubium avatar Nov 18 '25 01:11 strubium

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, z into SPRING_X/Y/Z constants preserves all previous functionality and method signatures.
  • NaturalCamera migration: Ensure the transition from ShockVector.applyForce() to SpringVector.addVelocity() maintains equivalent physics behavior.
  • Lombok correctness: Confirm generated accessors in RandomVector and SpringValue are compatible with existing call sites (especially setter for aggressiveness with 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.

โค๏ธ Share

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

coderabbitai[bot] avatar Nov 18 '25 01:11 coderabbitai[bot]

@coderabbitai generate docstrings

strubium avatar Nov 19 '25 15:11 strubium