Repository navigation
Add opt-in factions.clearHomeOnChunkLoss - #2232
Merged
Merged
Conversation
Behaviour check: no changeAll 120 rows behave as in v11.1.1. All 106 rows with a reviewed expectation match the documentation they cite. Run · rows from Dans-Plugins/plugin-fixtures · advisory, not a required check |
When on, a faction's home is removed as soon as the faction stops holding the chunk it is in: unclaimed (single, radius, autounclaim, unclaimall) or claimed over by another faction. The check sits in MfClaimService save/delete/deleteAllClaims, so every path is covered; disbanding passes clearHome = false. The home is cleared through MfFactionService.update, so both storage backends are covered, and members are notified with a new lang key. Off by default, with the code-side fallback matching, so existing servers see no change. drafted by Claude on behalf of Daniel Stephenson Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LYNeuncv2d9VZ6EKG3yU6d
MfFactionService.delete removes claims with deleteAllClaims(id, clearHome = false) so a faction being disbanded is never saved first. The four disband tests stubbed and verified the one-argument overload, which delete no longer calls; they now target the two-argument one. Their assertions are unchanged. drafted by Claude on behalf of Daniel Stephenson Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LYNeuncv2d9VZ6EKG3yU6d
dmccoystephenson
force-pushed
the
feature/clear-home-on-chunk-loss
branch
from
November 22, 2026 03:43
9807816 to
ebb914d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A server operator's feedback suggested that a faction's home should not survive losing the land it stands on. Today the home stays where it was set even after its chunk is unclaimed or taken in a war. With
factions.respawnAtFactionHomeon, that lets a defeated faction keep respawning inside territory the winner now holds.Change
factions.clearHomeOnChunkLoss, off by default. The code-side fallback is alsofalse, so existing servers see no change.MfClaimServiceso every path is covered:delete:/f unclaim(single and radius) and autounclaimdeleteAllClaims:/f unclaimallsave: when the chunk passes to another faction (conquest or overclaim). Re-saving a claim for the same faction leaves the home alone.deleteAllClaims(id, clearHome = false), so the disband path does not save the faction it is about to delete. The publicdeleteAllClaims(MfFactionId)and its@JvmNameare unchanged.MfFactionService.update, the same retry-on-conflict path other faction edits use, so the jOOQ and JSON backends both get the change. Only thehomefield changes, and no storage or migration change is needed.FactionHomeClearedOnChunkLossNotificationTitle/Body, added to all five lang files in each file's own encoding../check-lang-encoding.shpasses.CONFIG.md,FAQ.md,USER_GUIDE.mdandCHANGELOG.md(Unreleased → Added).Tests
MfClaimServiceClearHomeTesthas 9 tests: option off; own unclaim; another faction taking the chunk; same-faction re-save; unclaim-all; disband path; a chunk without the home; the same chunk coordinates in another world; and negative block coordinates landing in the right chunk. These 9 and the 22 existingMfClaimService*tests pass locally, andlintKotlinis clean. This change has not been tried in game.The four disband tests in
MfFactionServiceTeststubbed and verifieddeleteAllClaims(id). Disband now callsdeleteAllClaims(id, false), so those stubs and verifications were moved to it, with their assertions unchanged. The full suite passes locally on the rebased head: 1618 tests, 0 failures,lintKotlinclean and./check-lang-encoding.shclean.Java API: the public
deleteAllClaims(MfFactionId)keeps@JvmName("deleteAllClaimsByFactionId")and its JVM signature, so add-ons such as Fiefs keep linking. The new two-argument overload isinternal.drafted by Claude on behalf of Daniel Stephenson
🤖 Generated with Claude Code
https://claude.ai/code/session_01LYNeuncv2d9VZ6EKG3yU6d