Skip to content

refactor: enhance fishing api - #47

Merged
Trixmas merged 5 commits into
masterfrom
refactor/enhance-fishing-api
Oct 2, 2026
Merged

Trixmas merged 5 commits into
masterfrom
refactor/enhance-fishing-api

Conversation

@Trixmas

@Trixmas Trixmas commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

This PR apply the same DX improvements as shown in #46 but for the fishing system API.

Summary by CodeRabbit

  • New Features

    • Added support for building fishing loot tables with entries for entities, items, gems, damaged items, and enchanted books.
    • Custom lava and void fishing hooks now share consistent reeling behavior and launch trajectories.
  • Bug Fixes

    • Adjusted entity-catch chances based on fishing luck and combo bonuses.
    • Updated bonus experience awarded for fishing combos.
  • Tests

    • Added coverage for fishing bonuses, wait times, hook trajectories, and loot-table setup.

@Trixmas Trixmas added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request plugin: BlightedSMP labels Oct 2, 2026
@coderabbitai

coderabbitai Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 72691642-20e2-4b5e-ae71-6d16fafaee91

📥 Commits

Reviewing files that changed from the base of the PR and between b20194a and 67d47d5.

📒 Files selected for processing (12)
  • blighted-smp/src/main/java/fr/moussax/blightedSMP/BlightedSMP.java
  • blighted-smp/src/main/java/fr/moussax/blightedSMP/content/fishing/EndFishing.java
  • blighted-smp/src/main/java/fr/moussax/blightedSMP/content/fishing/NetherFishing.java
  • blighted-smp/src/main/java/fr/moussax/blightedSMP/content/fishing/OverworldFishing.java
  • blighted-smp/src/main/java/fr/moussax/blightedSMP/content/fishing/OverworldLavaFishing.java
  • blighted-smp/src/main/java/fr/moussax/blightedSMP/engine/fishing/FishingComboTracker.java
  • blighted-smp/src/main/java/fr/moussax/blightedSMP/engine/fishing/FishingListener.java
  • blighted-smp/src/main/java/fr/moussax/blightedSMP/engine/fishing/FishingLootTable.java
  • blighted-smp/src/main/java/fr/moussax/blightedSMP/engine/fishing/hooks/CustomFishingHook.java
  • blighted-smp/src/main/java/fr/moussax/blightedSMP/engine/fishing/hooks/LavaFishingHook.java
  • blighted-smp/src/main/java/fr/moussax/blightedSMP/engine/fishing/hooks/VoidFishingHook.java
  • blighted-smp/src/test/java/fr/moussax/blightedSMP/engine/fishing/FishingTest.java

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


📝 Walkthrough

Walkthrough

The fishing changes revise loot-table construction and rolling, migrate existing fishing tables, standardize custom-hook handling, and update bonus experience spawning. Tests cover combo bonuses, wait ticks, launch velocity, and loot-table construction.

Changes

Fishing system

Layer / File(s) Summary
Loot-table API and execution
blighted-smp/src/main/java/fr/moussax/blightedSMP/engine/fishing/FishingLootTable.java, blighted-smp/src/test/java/fr/moussax/blightedSMP/engine/fishing/FishingTest.java
FishingLootTable adds fluent entity and item registration methods, plus helpers for gems, damaged items, and enchanted books. Rolling uses selected entry amounts and calculates entity chance from the configured chance, Luck of the Sea, and combo bonus.
Fishing table migrations
blighted-smp/src/main/java/fr/moussax/blightedSMP/content/fishing/*
The End, Nether, Overworld, and Overworld Lava tables use the revised builder methods. Their listed entries, values, and conditions remain represented.
Custom-hook contract and dispatch
blighted-smp/src/main/java/fr/moussax/blightedSMP/engine/fishing/hooks/*, blighted-smp/src/main/java/fr/moussax/blightedSMP/engine/fishing/FishingListener.java, blighted-smp/src/main/java/fr/moussax/blightedSMP/BlightedSMP.java, blighted-smp/src/test/java/fr/moussax/blightedSMP/engine/fishing/FishingTest.java
CustomFishingHook provides shared lookup, cleanup, rod-type, and launch-velocity operations. Lava and void hooks implement the interface, and the listener uses it for reeling. Shutdown calls shared hook cleanup.
Combo bonus experience
blighted-smp/src/main/java/fr/moussax/blightedSMP/engine/fishing/FishingComboTracker.java, blighted-smp/src/test/java/fr/moussax/blightedSMP/engine/fishing/FishingTest.java
Bonus experience spawning uses the bonus amount directly and skips nonpositive amounts. Tests cover combo bonus values and fishing wait ticks.

Priority: ➖ Normal

Estimated code review effort: 4 (Complex) | ~45 minutes

Change: Refactor

Merge Risk: ⚪ Minimal · up to 67d47

This change refactors the fishing builder and hook APIs and migrates the existing loot tables to them. The supplied evidence shows no concrete behavioral regression, so the change appears ready to merge.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 78.23% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 124 functions across 12 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies a refactor that enhances the fishing API, which matches the primary changes to the fishing builder API, hook abstraction, and related tests.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Autopilot is currently an internal CodeRabbit preview.


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.

@Trixmas
Trixmas merged commit 367827e into master Oct 2, 2026
3 checks passed
@Trixmas
Trixmas deleted the refactor/enhance-fishing-api branch October 2, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request plugin: BlightedSMP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant