Skip to content

Add option to preserve town ruin permissions - #8274

Closed
MattDeWeerd wants to merge 1 commit into
TownyAdvanced:masterfrom
MattDeWeerd:feature/preserve-ruin-permissions
Closed

Add option to preserve town ruin permissions#8274
MattDeWeerd wants to merge 1 commit into
TownyAdvanced:masterfrom
MattDeWeerd:feature/preserve-ruin-permissions

Conversation

@MattDeWeerd

Copy link
Copy Markdown

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_open remains independent and can still make a ruined town joinable. do_plots_permissions_change_to_allow_all has no effect while ruin permission changes are disabled.


New Nodes/Commands/ConfigOptions:

  • town_ruining.town_ruins.do_permissions_change_on_ruin
    • Default: true (preserves existing behavior)
    • Set to false to leave permission settings unchanged.

Relevant Towny Issue ticket:

None.


Testing:

  • Full Maven reactor test suite: 146 tests passed, 0 failures.

Attestations

  • I have tested this pull request on a server.

This implementation and its tests were prepared with Codex assistance, so the repository template's no-LLM-influence declaration cannot truthfully be made.

Copilot AI lite review requested due to automatic review settings August 11, 2026 13:21
@MattDeWeerd

Copy link
Copy Markdown
Author

Genuinely did not think codex would open this pr by itself. I was meant to review it and test before opening it. Sorry.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 (default true) 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.

Comment on lines +121 to 125
if (changePermissions)
town.getPermissions().setAll(true);

//Return town blocks to the basic, unowned, type
for(TownBlock townBlock: town.getTownBlocks()) {
@LlmDl

LlmDl commented Aug 11, 2026

Copy link
Copy Markdown
Member

We don't accept ai-assisted pull requests.

@MattDeWeerd

Copy link
Copy Markdown
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants