Skip to content

fix: block early finishes and hits before materials - #26

Merged
XxFran10xX merged 1 commit into
mainfrom
fix/finish-and-hit-gates
Sep 28, 2026
Merged

XxFran10xX merged 1 commit into
mainfrom
fix/finish-and-hit-gates

Conversation

@XxFran10xX

@XxFran10xX XxFran10xX commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Since 0.1.5 (#25) any finish that isn't an exact match ruins the project with no refund. That includes a player who clicks the branding tool before they have added everything, where 0.1.4 only showed a message. 0.1.5 also let hits start before any material was added.

Change

  • Finishing waits until every material group and every hit group has at least the amount the project menu lists ("Requires N Wood Materials", "Requires N Metalworking hits"). Before that, the player gets "You have to add all the items before finishing" or "You need to complete all the hits before finishing". The project and its materials are kept.
  • Hits are refused ("You have to add all the items before working") until every material group has at least its listed amount.
  • Once those amounts are reached, fix: accept any input and ruin non-exact crafts #25's rules are unchanged. Any material and hit is still accepted, including extras. An exact match gives the furniture. Anything else fails and refunds nothing.

The gates use "at least", not "exactly", so an over-filled or wrong-wood bench can still be finished (and fail) instead of getting stuck like 0.1.4.

Testing

  • Local mvn clean verify
  • CI build
  • Dev bot test (TFMCDev01, woodworking-DEV-20260928-1537): 25/25 checks on Marauder Rum Bottles (live recipe: goldmaple x1, hit x6, small hit x1).
    • A hit with no materials is refused. Finishing with no materials, with no hits, or with 3/7 hits only shows the warning. The goldmaple stays on the bench and cancelling refunds it.
    • The exact recipe still gives the furniture.
    • Over-filled input (2 goldmaple + silk, 7 hits) and a wrong hit mix (7 hits, 0 small hits) still fail with no furniture and no refund. No rejection messages once materials are in.
    • No Woodworking errors in latest.log.

🤖 Generated with Claude Code

Finishing with the branding tool now waits until every material and hit
group has at least the amount the project menu lists. Before that it only
shows a message and the project is kept. Past that point the exact-match
check still decides between the furniture and a failed craft.

Hits are refused until every material group has at least its listed amount.

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

coderabbitai Bot commented Sep 28, 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: 970ec755-448e-4238-9b35-ce39483def0b

📥 Commits

Reviewing files that changed from the base of the PR and between 8a6573d and 65f0d1e.

📒 Files selected for processing (4)
  • README.md
  • src/main/java/net/tfminecraft/woodworking/station/StationFeedback.java
  • src/main/java/net/tfminecraft/woodworking/station/StationManager.java
  • src/main/java/net/tfminecraft/woodworking/station/WoodStation.java

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


📝 Walkthrough

Walkthrough

The woodworking station now checks material and hit completion before tool work and finishing. It returns distinct results for missing materials and missing hits, and StationManager provides corresponding feedback. The README describes these prerequisites.

Changes

Woodworking Station Progress Gates

Layer / File(s) Summary
Material and hit completion checks
src/main/java/net/tfminecraft/woodworking/station/StationFeedback.java, src/main/java/net/tfminecraft/woodworking/station/WoodStation.java
WoodStation checks material and hit buckets against their required amounts. Incomplete buckets return LACKING_ITEMS or LACKING_HITS before the existing exact-recipe and exact-hit checks.
Action feedback and documented prerequisites
src/main/java/net/tfminecraft/woodworking/station/StationManager.java, README.md
StationManager provides distinct feedback for missing materials and hits. The README states that tool work requires all material groups to meet their listed amounts, and finishing requires all hit groups to be complete.

Priority: ⬇️ Low

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

Change: Bug fix

Suggested reviewers: ryanbarlow97

Merge Risk: ⚪ Minimal · up to 65f0d

The material and hit prerequisites have no identified merge-blocking issue. Merge after normal checks.

Security Architecture Review

Security architecture risk: 🔵 Low · up to 65f0d

The new gates appear to narrow destructive behavior without expanding who can use a station. No new security weakness was established, though ownership and recovery behavior are not fully verified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — For the reviewed player route, the change affects progress and disposition of a selected station project, not the permission boundary or a new cross-service path. Direct callers outside that route remain unverified.

Trust Boundaries and Controls

  • observed — The event handler rejects players without woodworking permission before either click handler runs. The examined path does not establish station-specific ownership isolation; the diff does not introduce an ownership check or remove an existing one.

Resilience and Maintainability Implications

  • inferred — Repeated early hit or finish attempts do not advance counters or invoke failure cleanup on the reviewed route. Crash atomicity between output creation and station removal remains unproven, but that sequence predates this change.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 88.89% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 3 files. (1 skipped: 1 u…
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: it blocks early finishes and hit attempts before materials are complete.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

A rabbit taps the timber stack,
“More materials before the whack!”
When every hit is counted through,
The finish waits, then comes in view.
The workshop hops along anew.

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

@XxFran10xX
XxFran10xX merged commit b089c04 into main Sep 28, 2026
2 checks passed
@XxFran10xX
XxFran10xX deleted the fix/finish-and-hit-gates branch September 28, 2026 15:44
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.

1 participant