Repository navigation
feat: pass a solo realm to its dead leader's will heir - #206
Conversation
A realm whose last member died is held for a week and then closes. Once held-realm-heir-wait-hours (24) have passed, the heir named in the dead leader's will now takes it on, if alive and in no faction, unless staff held or reverted the estate. Checked hourly and when the heir starts playing; an heir in another faction is told to leave it first. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Configure heir eligibility src/main/java/net/tfminecraft/simplefactions/Cache.java, src/main/java/net/tfminecraft/simplefactions/loaders/ConfigLoader.java, src/main/resources/config.yml, src/main/java/net/tfminecraft/simplefactions/integration/rpcharacters/WillHeirs.java, src/main/java/net/tfminecraft/simplefactions/estate/EstateBridge.java, src/main/java/net/tfminecraft/simplefactions/estate/EstateCalls.java, src/test/java/net/tfminecraft/simplefactions/integration/rpcharacters/WillHeirsTest.java, src/test/java/net/tfminecraft/simplefactions/estate/EstateBridgeTest.java |
Adds the configurable heir wait period, resolves the heir from the deceased character’s saved data, and checks whether the estate permits inheritance. Tests cover lookup and estate-check outcomes. |
Apply held-realm inheritance src/main/java/net/tfminecraft/simplefactions/guild/HeldRealms.java, src/main/java/net/tfminecraft/simplefactions/identity/LeaderCharacterListener.java, src/test/java/net/tfminecraft/simplefactions/guild/HeldRealmsHeirTest.java, src/test/java/net/tfminecraft/simplefactions/guild/HeldRealmsTest.java |
Attempts inheritance on character start and during hourly processing. Checks eligibility and the held-week deadline, saves the heir as leader, and restores the held state after a failed save. Tests cover these conditions and retry behaviour. |
Priority:
Estimated code review effort: 4 (Complex) | ~45 minutes
Change: Feature
Sequence Diagram(s)
sequenceDiagram
participant LeaderCharacterListener
participant HeldRealms
participant WillHeirs
participant EstateBridge
LeaderCharacterListener->>HeldRealms: heirStarted(member key, current time)
HeldRealms->>WillHeirs: Resolve the deceased leader's named heir
HeldRealms->>EstateBridge: Check estate inheritance eligibility
HeldRealms->>HeldRealms: Validate conditions and save the heir as leader
Suggested reviewers: ryanbarlow97
Merge Risk: 
Minimal · up to b9fd8
-
No demonstrated issue blocks merging; run the normal checks before release.
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.
Comment @coderabbitai help to get the list of available commands.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@coderabbitai review |
✅ Action performed
|
Summary
Solo players lose their faction when their character dies for good. The realm is held for a week (
HeldRealms) and then closes unless staff seat someone. This lets a will carry the realm on, so players like egg (Omeleth) keep their progress.held-realm-heir-wait-hours(24, matching RPCharacters'estates.wait-hours) have passed since the death, the heir named in the dead leader's will joins the held realm and becomes its leader. A revive inside that window still gives the realm back to the leader first.will-heir) throughDatabase.readSavedAccount. That method is in the pinned rpcharacters 2.16.0 and in 2.31.0, so the dependency does not change. A will cannot change after death, and RPCharacters' own estate reconcile reads the same field. Without RPCharacters, or if the file can't be read, nobody inherits.GuildEstateFallbackstops answering UNAVAILABLE and the estate decides as usual: the guild leader (the heir) gets the property and the locks.Player messages:
<dead> left you <realm> in their will. You now lead it.<dead> left you <realm> in their will. Leave <faction> within N days to take it on.Tests
HeldRealmsHeirTestcovers: the wait, revive priority, session start, an heir in another faction (with the deadline text), no usable will, a dead heir, an estate stopped by staff, a realm staff let someone into, a closing realm, an unreadable leader, save failure and rollback, the config wait, and the expired week with and without a war.WillHeirsTestcovers reading the file and every way the heir can be missing or unreadable.EstateBridgeTestcoversheirMayInheritfor each estate state and failure.HeldRealmsTest,GuildEstateFallbackTest); Linux CI is authoritative.Dev (TFMCDev01)
Tested with this branch's jar (b34c3f1, then b9fd88a) and
held-realm-heir-wait-hours: 0.05, using bots with real characters:Willhold, named WillHeirB's character in/will, and was permakilled. The realm was held.Gave Willhold to <B>, the will heir of its dead leader <A>. B is the leader and only member, and the hold is cleared.Gave Willhold to <E>, the will heir of its dead leader <D>.Wiki
/wiki/characters, "Wills and inheritance", says "Leading a guild or realm never passes by will." That is no longer true for the last member of a realm and needs a separate TFMCWeb change. The hidden wait and the details can stay off the wiki; one line is enough, e.g. "If your character was the last member of their realm, your heir takes it on a day after your death, if they are alive and in no faction."Reviewed by Sol (round 1 found the expired-week case, fixed in b34c3f1; round 2 approved).
🤖 Generated with Claude Code