Skip to content

Say when the one-county-per-member limit blocks a county - #219

Merged
XxFran10xX merged 1 commit into
mainfrom
fix/county-limit-lore
Oct 30, 2026
Merged

XxFran10xX merged 1 commit into
mainfrom
fix/county-limit-lore

Conversation

@XxFran10xX

Copy link
Copy Markdown
Contributor

Why

A player owned 5/5 provinces of Thrymsdal and the County View said only "Unavailable". The hidden reason was the rule that a realm holds at most one county per member, and their realm already held as many counties as it has members. Nothing in the menu said so.

What changes

  • Unclaimed counties that are blocked by the limit now show, under "Unavailable":
    • County limit reached: 1/1 (one per member) (counties held / members)
    • Recruit more members to hold another county.
  • The "Create a new County" button shows the same two lines at the limit, and says "Unavailable" instead of "Click to create". Clicking it already refused with "You need more members to form more counties!".
  • The limit check moved into Title.countyLimitReached, used by the claim check, the create-button click and both menu items. The rule itself is unchanged.

Counties owned by another realm and counties the realm already holds don't get the lines.

Tests

  • New ArmyMenusCoverageTest.countyButtonsSayWhenTheOneCountyPerMemberLimitBlocksThem: at 1 member / 1 county the lines appear on an unclaimed county and on the create button; with a second member they're gone and the county is claimable.
  • Locally the title/menu tests pass. The full suite has the same Windows-only failures as unchanged main (directory fsync AccessDeniedException); Linux CI is the real check.

🤖 Generated with Claude Code

A realm can hold at most one county per member, but the County View only
showed "Unavailable" next to a full province count, so players thought they
could claim it. Unclaimed counties and the "Create a new County" button now
show "County limit reached: held/members (one per member)" and ask for more
members. The create button no longer says "Click to create" at the limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3a3977da-6d67-4a96-a261-a0c8d644a292
Commits

Reviewing files that changed from the base of the PR and between b70da92 and e8134b1.

Files selected for processing: 4
  • src/main/java/net/tfminecraft/simplefactions/managers/inventory/TierTitleCreator.java
  • src/main/java/net/tfminecraft/simplefactions/managers/inventory/TierTitleView.java
  • src/main/java/net/tfminecraft/simplefactions/tiers/Title.java
  • src/test/java/net/tfminecraft/simplefactions/managers/inventory/ArmyMenusCoverageTest.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.

📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • County titles can no longer be claimed or created once the faction’s county-title limit is reached, based on its member count.
    • Unavailable county titles now show the current title count against the member count and explain that recruiting members can increase the limit.
    • County titles become available for claiming or creation again when the faction has enough members.

County title creation now uses a shared limit check based on the faction’s county-title count and member count. Inventory items show limit lore when the limit blocks a county title, and tests cover availability before and after adding a member.

Changes: County title limit

Layer / File(s) Summary
Shared limit check and creation guard
src/main/java/net/tfminecraft/simplefactions/tiers/Title.java, src/main/java/net/tfminecraft/simplefactions/managers/inventory/TierTitleView.java
Title adds static and instance county-limit checks. Title creation and county formation use the check to stop when the limit is reached.
Inventory availability and limit message
src/main/java/net/tfminecraft/simplefactions/managers/inventory/TierTitleCreator.java, src/test/java/net/tfminecraft/simplefactions/managers/inventory/ArmyMenusCoverageTest.java
Unavailable county titles and new-title items display the county-title count against the member count. The test checks item availability and limit messages before and after adding a member.

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

Change: Feature

Suggested reviewers: ryanbarlow97

Merge Risk: Minimal · up to e8134

The change explains county limits without changing the rule. No actionable merge-blocking issue remains after normal checks.

- [ ] 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.

@github-actions github-actions Bot added the size:S 10-29 effective changed lines (tests excluded in mixed PRs). label Oct 30, 2026
@XxFran10xX
XxFran10xX marked this pull request as ready for review October 30, 2026 19:41
@XxFran10xX

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@XxFran10xX

Copy link
Copy Markdown
Contributor Author

Dev bot test (TFMCDev01, 10-30 19:37 UTC): a 1-member realm holding COUNTY_8 sees the limit lines on Orseime and on Create a new County; after a second member joins both are gone. 7/7 checks pass.

@coderabbitai

coderabbitai Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@XxFran10xX
XxFran10xX merged commit 27d5c50 into main Oct 30, 2026
4 checks passed
@XxFran10xX
XxFran10xX deleted the fix/county-limit-lore branch October 30, 2026 19:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 effective changed lines (tests excluded in mixed PRs).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant