Skip to content

fix: refuse branding a station without a recipe - #20

Merged
Drefvelin merged 1 commit into
mainfrom
fix/branding-without-recipe
Sep 24, 2026
Merged

Drefvelin merged 1 commit into
mainfrom
fix/branding-without-recipe

Conversation

@Drefvelin

@Drefvelin Drefvelin commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Left-clicking a crafting station with the branding tool before a recipe is chosen called craft() with a null recipe. It threw a NullPointerException (seen on TFMCMain 2026-09-23 20:37). The player now gets "No recipe on this station. Select a recipe first."

Verification

  • mvn package builds.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • When no recipe is available, crafting now displays a message and plays a failure sound instead of attempting to craft.

Left-clicking a station with the branding tool before choosing a recipe
called craft() with a null recipe and threw a NullPointerException.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 24, 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: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 2a2baef5-578e-4c59-9b5e-debc6333d33a

📥 Commits

Reviewing files that changed from the base of the PR and between 689e0ea and 3bb16cf.

📒 Files selected for processing (1)
  • src/main/java/net/tfminecraft/advancedcrafting/managers/CraftingManager.java

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The branding tool crafting flow now checks whether the station has a recipe. If it does not, the player receives a selection prompt and failure sound, and crafting stops.

Changes

Branding tool crafting

Layer / File(s) Summary
Check recipe before crafting
src/main/java/net/tfminecraft/advancedcrafting/managers/CraftingManager.java
When the station has no recipe, applyHit sends a selection prompt and failure sound, then returns without calling station.craft(p).

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Suggested reviewers: ryanbarlow97

Merge Risk: ⚪ Minimal · up to 3bb16

The change prevents branding without a selected recipe from reaching the failing craft call. No actionable merge-blocking risk remains.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 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 and concisely describes the main change: preventing branding when a station has no recipe.
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

A rabbit checks the recipe first,
No recipe? Crafting does not burst.
A prompt appears, a sound rings clear,
The station waits for choices here.
I hop along, my work is done.

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

@Drefvelin
Drefvelin merged commit b17fce5 into main Sep 24, 2026
2 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.

2 participants