Skip to content

fix: a held realm keeps its nodes - #25

Merged
XxFran10xX merged 3 commits into
mainfrom
fix/held-realm-keeps-nodes
Oct 26, 2026
Merged

XxFran10xX merged 3 commits into
mainfrom
fix/held-realm-keeps-nodes

Conversation

@XxFran10xX

Copy link
Copy Markdown
Contributor

Summary

When a realm's last member dies, SimpleFactions holds the realm for a revive or for the will heir (4.15.0). Dowsing checks every node four times a second and released any node whose guild had fewer than min-members-for-node members. A held realm has none, so its nodes became claimable the moment its last member died, and any guild leader could take them.

On Main this happened to Eastern Territories' node at Sumdalgrad when Lyza died on 10-26. It now reads guild: none and shows the claimable particles.

Changes

  • Node.canHold keeps a node whose guild SimpleFactions holds (Guild.isHeld()).
  • While held, the node pauses:
    • Production: the production cycle skips it.
    • Upkeep: getTotalUpkeep reports 0. SimpleFactions already pauses a held realm's other upkeep, but node upkeep comes from Dowsing's total.
    • Efficiency: the hourly efficiency growth skips it. It caps efficiency at the guild's member count, so the node would have dropped to 0% within an hour.
  • A closed realm's guild is gone, so its nodes are still freed then.
  • Only the realm's own guild is held. An emptied secondary guild in the same realm still loses its nodes, as before.
  • Dependency: SimpleFactions goes from 4.0.0 to 4.7.0, the first release with Guild.isHeld(). On an older SimpleFactions the call falls back to the member rule.

Tests

  • Unit tests:
    • a held node is kept, keeps its efficiency, and is released once no longer held;
    • the fallback for an older SimpleFactions;
    • upkeep is 0 and production is paused while held.
    • Line coverage stays at 100%.
    • Locally on Windows, DatabaseTest and NodePaymentsTest fail the same way on main (directory fsync), so CI is the reference.
  • Dev (with RPCharacters #139):
    • A bot founded a solo realm and I wrote it a node on a barrier while Dev was stopped. The bot named its second character as heir and was permakilled, with the wait cut to 3 minutes.
    • After the hand-over, the heir's click opened the node menu with no "Claimed Node" message, so the node was never released.
    • The node file saved at shutdown still named the realm, at 25% efficiency.
    • Dev is back on 3.2.5 and the test node is removed.

🤖 Generated with Claude Code

XxFran10xX and others added 3 commits October 26, 2026 10:59
A realm whose last member died is held by SimpleFactions for a revive or
its will heir, but Dowsing released its nodes four times a second because
the guild had no members, so anyone could claim them. Held guilds now keep
their nodes; a closed realm's guild is gone, which still frees them.
SimpleFactions is bumped to 4.7.0 for Guild.isHeld; an older one falls
back to the member rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SimpleFactions pauses a held realm's other upkeep, but node upkeep comes
from Dowsing's total, so a kept node would have charged its treasury
every day of the hold and produced for nobody.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review: the hourly efficiency growth caps a node at its guild's member
count, which is zero while the realm is held, so a kept node fell to 0%
an hour after the death and the heir got it back 4x slower.

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

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Oct 26, 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: e928e373-1edd-4ce2-a3dd-069ef313999c
Commits

Reviewing files that changed from the base of the PR and between cfab588 and 49de9dd.

Files selected for processing: 5
  • pom.xml
  • src/main/java/net/tfminecraft/dowsing/managers/NodeManager.java
  • src/main/java/net/tfminecraft/dowsing/objects/Node.java
  • src/test/java/net/tfminecraft/dowsing/managers/NodeManagerCyclesTest.java
  • src/test/java/net/tfminecraft/dowsing/objects/NodeBehaviorTest.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
    • Nodes belonging to held realms no longer produce resources, load chunks for processing or gain efficiency. They can still be claimed while the realm is held, and become subject to the usual member-count rules once it is released.
  • Chores
    • Updated the SimpleFactions version reference.

The change adds held-guild checks to node retention, efficiency growth, upkeep, and cycle processing. It also updates the SimpleFactions version and adds tests for held-guild behaviour and compatibility when Guild.isHeld() is unavailable.

Changes: Held guild node handling

Layer / File(s) Summary
Held-state checks and node behaviour
pom.xml, src/main/java/net/tfminecraft/dowsing/objects/Node.java, src/test/java/net/tfminecraft/dowsing/objects/NodeBehaviorTest.java
The SimpleFactions version changes from 4.0.0 to 4.7.0. Node.held checks whether a guild is held and returns false if the call raises LinkageError. canHold accepts held guilds before its existing checks, and growEfficiency skips held guilds. Tests cover held-state behaviour and fallback behaviour when Guild.isHeld() is unavailable.
Upkeep and cycle processing
src/main/java/net/tfminecraft/dowsing/managers/NodeManager.java, src/test/java/net/tfminecraft/dowsing/managers/NodeManagerCyclesTest.java
getTotalUpkeep returns zero for held guilds. The processing loop skips held-guild nodes before chunk loading and production. A test checks that held nodes are not ticked, do not construct an ItemDropper, and do not force-load their chunk.

Priority: Normal

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

Change: Bug fix

Suggested reviewers: ryanbarlow97

Merge Risk: Minimal · up to 49de9

No actionable issue remains from the reviewed held-node changes; the PR is mergeable 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 26, 2026
@coderabbitai

coderabbitai Bot commented Oct 26, 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 58aa935 into main Oct 26, 2026
3 checks passed
@XxFran10xX
XxFran10xX deleted the fix/held-realm-keeps-nodes branch October 26, 2026 10:51
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