Add option to preserve town ruin permissions - #8274
Conversation
|
Genuinely did not think codex would open this pr by itself. I was meant to review it and test before opening it. Sorry. |
There was a problem hiding this comment.
Pull request overview
Adds a new, backwards-compatible configuration option to control whether a town’s permission lines and plot-level permission customizations are altered when the town becomes a ruin, enabling “reclaim windows” without automatically making ruins lootable.
Changes:
- Introduces
town_ruining.town_ruins.do_permissions_change_on_ruin(defaulttrue) to optionally preserve town/plot permissions through ruin + reclaim. - Updates ruin/reclaim logic to conditionally skip permission resets and to keep plot permission overrides/trusted residents when configured.
- Adds focused config behavior tests and documents the option in the changelog.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Towny/src/test/java/com/palmergames/bukkit/towny/config/TownRuinConfigTests.java | Adds tests covering default behavior, gating of progressive plot-opening, and independence of ruins_become_open. |
| Towny/src/main/resources/ChangeLog.txt | Documents the new config option and its behavioral implications. |
| Towny/src/main/java/com/palmergames/bukkit/towny/utils/TownRuinUtil.java | Applies the new setting during ruin and reclaim to optionally preserve permissions/overrides/trusted residents. |
| Towny/src/main/java/com/palmergames/bukkit/towny/TownySettings.java | Adds doRuinsPermissionsChange() and gates progressive plot-opening behind it. |
| Towny/src/main/java/com/palmergames/bukkit/config/ConfigNodes.java | Adds the new config node with inline documentation and default value. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if (changePermissions) | ||
| town.getPermissions().setAll(true); | ||
|
|
||
| //Return town blocks to the basic, unowned, type | ||
| for(TownBlock townBlock: town.getTownBlocks()) { |
|
We don't accept ai-assisted pull requests. |
|
I do apologize, this was purely supposed to be a quick local test with codex to see if what I was looking to do would actually work like I thought it would. I did not ask it to make the PR and had no intentions to submit a low effort ai created pr |
Description:
Adds a backwards-compatible town ruin option that preserves town and plot permission settings, allowing ruins to serve as a final reclaim window without automatically making them lootable.
When disabled, permission lines, plot permission overrides, and trusted-resident settings remain intact through ruin and reclaim.
ruins_become_openremains independent and can still make a ruined town joinable.do_plots_permissions_change_to_allow_allhas no effect while ruin permission changes are disabled.New Nodes/Commands/ConfigOptions:
town_ruining.town_ruins.do_permissions_change_on_ruintrue(preserves existing behavior)falseto leave permission settings unchanged.Relevant Towny Issue ticket:
None.
Testing:
Attestations
This implementation and its tests were prepared with Codex assistance, so the repository template's no-LLM-influence declaration cannot truthfully be made.