Skip to content

Render Clean#617

Merged
Desoroxxx merged 6 commits intonextfrom
strubium/render-clean
Nov 17, 2025
Merged

Render Clean#617
Desoroxxx merged 6 commits intonextfrom
strubium/render-clean

Conversation

@strubium
Copy link
Copy Markdown
Contributor

@strubium strubium commented Nov 11, 2025

📝 Description

Cleanup parts of code important for rendering

🎯 Goals

  • Make code easier to understand
  • Save file size

❌ Non Goals

  • Change renderering in any way

🚦 Testing

Builds and runs, looks fine

⏮️ Backwards Compatibility

yes

📚 Related Issues & Documents

#581 #611

🖼️ Screenshots/Recordings

N/a

📖 Added to documentation?

  • 📜 README.md
  • 📑 Documentation
  • 📓 Javadoc
  • 🍕 Comments
  • 🙅 No documentation needed

@strubium strubium requested a review from Desoroxxx November 11, 2025 17:57
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 11, 2025

Walkthrough

Removed a small data holder, adopted Lombok for many accessors/constructors, replaced several explicit generics with the diamond operator and cleaned imports, swapped a few comparator/ADS calls, consolidated Minecraft singleton usage, removed five framebuffer API methods, and simplified some renderer/null-checks and UI color logic.

Changes

Cohort / File(s) Summary
Removed lightweight class
src/main/java/com/paneedah/weaponlib/ExpirableRenderableState.java
Deleted a simple data container (state, expiresAt, singleUse) and its constructor.
Lombok adoption & accessor/constructor removal
src/main/java/com/paneedah/weaponlib/ai/EntityClassFactory.java, src/main/java/com/paneedah/weaponlib/animation/ScreenShakingAnimationManager.java, src/main/java/com/paneedah/weaponlib/compatibility/RecoilParam.java, src/main/java/com/paneedah/weaponlib/WeaponState.java, src/main/java/com/paneedah/weaponlib/MagazineState.java, src/main/java/com/paneedah/weaponlib/WeaponSpawnEntity.java, src/main/java/com/paneedah/weaponlib/vehicle/VehicleSuspensionStrategy.java, src/main/java/com/paneedah/weaponlib/TransitionContainer.java, src/main/java/com/paneedah/weaponlib/WeaponAttachmentAspect.java
Added Lombok annotations (@Getter, @Setter, @NoArgsConstructor) and removed explicit getters/setters/constructors; some fields made final or renamed (e.g., stackitemStack). Singleton getters now generated by Lombok.
Comparator / minor logic tweaks
src/main/java/com/paneedah/weaponlib/WeightedOptions.java, src/main/java/com/paneedah/weaponlib/WeaponReloadAspect.java
Replaced float lambda compare with Float.compare; swapped ammo lambdas for Comparator.comparingInt(Tags::getAmmo) (stylistic).
ADS accessor name change
src/main/java/com/paneedah/weaponlib/animation/movement/WeaponRotationHandler.java
Replaced getADSSimilarity() call with getAdsSimilarity() in ADS branch.
Minecraft singleton consolidation
src/main/java/com/paneedah/weaponlib/render/Bloom.java
Removed class-level MC field and replaced Minecraft.getMinecraft() usages with a centralized MC alias via static import.
Framebuffer API removal
src/main/java/com/paneedah/weaponlib/render/framebuffer/MultisampledFramebuffer.java
Removed five public methods: setFramebufferFilter, bindFramebuffer, unbindFramebuffer, setFramebufferColor, framebufferClear.
Diamond operator & import cleanup (grenades & melee)
src/main/java/com/paneedah/mwc/items/grenade/*, src/main/java/com/paneedah/mwc/items/melee/*
FlashGrenadeFactory.java, FuseGrenadeFactory.java, GasGrenadeFactory.java, ImpactGrenadeFactory.java, SmokeGrenadeFactory.java, BaseballBatFactory.java, BaseballBatNailsFactory.java, NightStickFactory.java, TacticalTomahawkFactory.java
Replaced explicit Transition<RenderContext<RenderableState>> with Transition<> (diamond) across many factories; removed now-unused imports; minor numeric literal formatting (000).
UI color tweak
src/main/java/com/paneedah/weaponlib/animation/gui/Textbar.java
Replaced a fixed rectangle background color with a hover-responsive color variable in button rendering.
Minor cleanup: imports, null-check & signature tweak
src/main/java/com/paneedah/weaponlib/electronics/HandheldState.java, src/main/java/com/paneedah/weaponlib/electronics/WirelessCameraRenderer.java, src/main/java/com/paneedah/weaponlib/tracking/LivingEntityTracker.java
Removed unused import(s); simplified redundant inner null-check in renderer; removed final from getTracker method signature.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Check for any remaining callers of the removed MultisampledFramebuffer methods and update call sites.
  • Verify Lombok is present in the build and generated accessor names/visibilities (singleton getters, renamed fields like itemStack, and final-field initializations).
  • Search for usages of the deleted ExpirableRenderableState and confirm callers were migrated.
  • Confirm Bloom's static-import MC resolves and framebuffer texture/size references compile.
  • Scan files where diamond operator was introduced for any type-inference issues or removed imports that are still needed.

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 4.35% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Title check ❓ Inconclusive The title 'Render Clean' is vague and uses a non-descriptive term that doesn't convey meaningful information about the specific changes made in the changeset. Consider a more specific title like 'Refactor rendering code with Lombok annotations and clean up redundant methods' to better communicate the main changes.
✅ Passed checks (1 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly relates to the changeset, explaining that code important for rendering is being cleaned up to make it easier to understand and reduce file size without changing rendering behavior.
✨ 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/render-clean

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/main/java/com/paneedah/weaponlib/electronics/WirelessCameraRenderer.java (1)

26-39: Unnesting improves readability.

The removal of the redundant inner null-check makes the code flow clearer. However, there are opportunities for further cleanup that align with the PR's stated goals.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 750f826 and ee5fac8.

📒 Files selected for processing (7)
  • src/main/java/com/paneedah/mwc/items/melee/BaseballBatFactory.java (7 hunks)
  • src/main/java/com/paneedah/mwc/items/melee/BaseballBatNailsFactory.java (7 hunks)
  • src/main/java/com/paneedah/mwc/items/melee/NightStickFactory.java (7 hunks)
  • src/main/java/com/paneedah/mwc/items/melee/TacticalTomahawkFactory.java (7 hunks)
  • src/main/java/com/paneedah/weaponlib/animation/gui/Textbar.java (1 hunks)
  • src/main/java/com/paneedah/weaponlib/electronics/HandheldState.java (0 hunks)
  • src/main/java/com/paneedah/weaponlib/electronics/WirelessCameraRenderer.java (1 hunks)
💤 Files with no reviewable changes (1)
  • src/main/java/com/paneedah/weaponlib/electronics/HandheldState.java
🧰 Additional context used
🧬 Code graph analysis (1)
src/main/java/com/paneedah/weaponlib/animation/gui/Textbar.java (1)
src/main/java/com/paneedah/weaponlib/animation/gui/AnimationGUI.java (1)
  • AnimationGUI (38-486)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: build
  • GitHub Check: Analyze (java-kotlin)
  • GitHub Check: build
🔇 Additional comments (10)
src/main/java/com/paneedah/mwc/items/melee/TacticalTomahawkFactory.java (2)

22-22: LGTM! Clean integer literal.

The change from 00 to 0 removes redundant notation and improves readability without affecting behavior.


88-94: LGTM! Diamond operator adoption improves code clarity.

The consistent replacement of explicit generic types with the diamond operator (Transition<>) across all animation transitions reduces verbosity while maintaining type safety. This aligns well with the PR's goals of improving readability and reducing file size.

Also applies to: 95-101, 102-108, 111-117, 118-124, 125-131, 135-141, 142-148, 149-155, 159-165, 166-172, 175-181, 182-188, 191-197, 198-204

src/main/java/com/paneedah/weaponlib/animation/gui/Textbar.java (1)

42-56: LGTM! Dynamic color enhances hover feedback.

The change from a fixed darker shade to a dynamic color based on hover state improves the user experience by providing visual feedback.

src/main/java/com/paneedah/mwc/items/melee/BaseballBatFactory.java (2)

22-23: LGTM! Cleaned up integer literals.

The change from 00 to 0 is a formatting improvement with no behavioral change.


84-137: LGTM! Diamond operator usage improves code clarity.

The switch from explicit generic type parameters to the diamond operator (Transition<>) leverages Java's type inference and makes the code more concise without sacrificing type safety.

src/main/java/com/paneedah/mwc/items/melee/NightStickFactory.java (2)

24-25: LGTM! Integer literal cleanup.

Consistent with other factory classes in this PR.


86-160: LGTM! Diamond operator usage improves maintainability.

The type inference through the diamond operator makes the transition definitions more concise while maintaining type safety.

src/main/java/com/paneedah/mwc/items/melee/BaseballBatNailsFactory.java (2)

24-25: LGTM! Consistent integer literal formatting.

Aligns with the cleanup applied across other melee factory classes.


86-139: LGTM! Diamond operator refactoring is well-applied.

The transition to type-inferred generics is consistent with the broader refactoring effort across the codebase and improves code readability.

src/main/java/com/paneedah/weaponlib/electronics/WirelessCameraRenderer.java (1)

14-16: LGTM!

The constructor correctly uses the MC alias for accessing the render manager, consistent with this PR's cleanup approach.

@Cubed-Development Cubed-Development deleted a comment from coderabbitai Bot Nov 14, 2025
Copy link
Copy Markdown
Member

@Desoroxxx Desoroxxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few tiny things

Comment thread src/main/java/com/paneedah/weaponlib/animation/gui/Textbar.java
Comment thread src/main/java/com/paneedah/weaponlib/electronics/WirelessCameraRenderer.java Outdated
@strubium
Copy link
Copy Markdown
Contributor Author

@Desoroxxx everything i removed from
MultisampledFramebuffer is the same as what it extends from so keeping it is unnecessary

@Desoroxxx
Copy link
Copy Markdown
Member

@Desoroxxx everything i removed from MultisampledFramebuffer is the same as what it extends from so keeping it is unnecessary

Oh okie

coderabbitai[bot]

This comment was marked as off-topic.

Copy link
Copy Markdown
Member

@Desoroxxx Desoroxxx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Desoroxxx Desoroxxx merged commit b1d10cb into next Nov 17, 2025
6 of 7 checks passed
@Desoroxxx Desoroxxx deleted the strubium/render-clean branch November 17, 2025 12:27
strubium added a commit that referenced this pull request Nov 17, 2025
strubium added a commit that referenced this pull request Nov 17, 2025
* Render Clean (#617)

* Updated to `Gradle` 9.2.0

* Updated dependencies

* Turned on configuration cache

* Reordered `jvmargs`

* Update Changelog.md

* Update JDK version from 24 to 25 in build workflow

* Render Clean (#617)

* Updated to `Gradle` 9.2.0

* Updated dependencies

* Turned on configuration cache

* Reordered `jvmargs`

* Update Changelog.md

* Update JDK version from 24 to 25 in build workflow

---------

Co-authored-by: Luna Mira Lage (Desoroxxx) <desoroxxx.git@redstudio.dev>
@strubium strubium mentioned this pull request Nov 18, 2025
5 tasks
@coderabbitai coderabbitai Bot mentioned this pull request Feb 10, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants