Skip to content

Use ModifyExpressionValue for the fishing line camera check - #667

Merged
tr7zw merged 1 commit into
tr7zw:mainfrom
4rtefakt:fix/fishing-redirect-mixinextras
Oct 20, 2026
Merged

tr7zw merged 1 commit into
tr7zw:mainfrom
4rtefakt:fix/fishing-redirect-mixinextras

Conversation

@4rtefakt

Copy link
Copy Markdown
Contributor

Fixes #666

Replaces the @Redirect on Options#getCameraType in FishingBobberRendererMixin with MixinExtras' @ModifyExpressionValue on > 1.20.4. Behavior is the same. ModifyExpressionValue#at is an array by design, so the built jar no longer trips MixinExtras' redirect wrapper (see the issue). It also chains with other mods touching the same call instead of conflicting.

<= 1.20.4 keeps its @Redirects, since older Fabric Loader versions don't bundle MixinExtras. Those are encoded the same way, so the build-side quirk may be worth a look in ProcessedModTemplate.

.\gradlew clean build passes for all versions. The built 1.21.1 and 26.3 Fabric jars no longer contain a @Redirect.

Investigated with the help of an AI assistant; I reviewed the change and the diagnosis myself.

@coderabbitai

coderabbitai Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

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: 3700f858-5b59-47f9-a724-65e9b762f7b9
📥 Commits

Reviewing files that changed from the base of the PR and between a56226b and 03e0429.

📒 Files selected for processing: 1
  • src/main/java/dev/tr7zw/firstperson/mixins/FishingBobberRendererMixin.java

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Walkthrough

The fishing bobber renderer mixin replaces its camera-type redirect with a @ModifyExpressionValue hook. The hook returns third-person-back when doCorrect() is true and otherwise returns the supplied camera type.

Changes

Fishing Bobber Renderer Hook

Layer / File(s) Summary
Camera type hook
src/main/java/dev/tr7zw/firstperson/mixins/FishingBobberRendererMixin.java
For versions above 1.20.4, the mixin imports the MixinExtras injector annotation and uses @ModifyExpressionValue to receive the camera type directly. The hook retains the existing doCorrect() condition.

Priority: ➖ Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 03e04

The camera-type hook retains the existing behavior across supported versions; no actionable merge-blocking risk remains.

Pre-merge checks: Passed 5
Passed Passed checks: 5 passed
Check name Status Explanation
Title check Passed The title clearly identifies the main change: replacing the fishing line camera check with MixinExtras' ModifyExpressionValue injector.
Description check Passed The description directly explains the injector replacement, preserved behavior, version-specific handling, and the issue being fixed.
Linked Issues check Passed Issue #666 requires removal of the affected @Redirect for versions above 1.20.4. The reviewed FishingBobberRendererMixin.java uses MixinExtras @ModifyExpressionValue on the `Options#getCameraTyp…
Out of Scope Changes check Passed The supplied whole-PR summary identifies one focused change in FishingBobberRendererMixin.java: replacement of the affected redirect and the corresponding hook signature. The reviewed file shows no …
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 1 files.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · 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.

@sonarqubecloud

Copy link
Copy Markdown

@tr7zw

tr7zw commented Oct 20, 2026

Copy link
Copy Markdown
Owner

Haven't heard of that crash before, but the PR looks fine and seems to work, so sure.

@tr7zw
tr7zw merged commit 6b5859f into tr7zw:main Oct 20, 2026
3 checks passed
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.

Fishing line mixin crashes MixinExtras' redirect wrapper ("Mixin transformation of FishingBobberEntityRenderer failed")

2 participants