Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 16 additions & 10 deletions Towny/src/main/java/com/palmergames/bukkit/config/ConfigNodes.java
Original file line number Diff line number Diff line change
Expand Up @@ -3521,16 +3521,22 @@ public enum ConfigNodes {
"false",
"",
"# When this is true, players who have no town can also reclaim the ruin. While false, only residents of the Town can reclaim the ruin."),
TOWN_RUINING_TOWN_DEPOSITS_BANK_TO_NATION(
"town_ruining.town_ruins.town_bank_is_sent_to_nation",
"false",
"",
"# If this is true, when a town becomes a ruin, and they are a member of a nation, any money in the town bank will be deposited to the nation bank."),
Comment on lines -3524 to -3528

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Unneeded diff. Probably whitespacing, needs to change back so there is no diff.

TOWN_RUINING_TOWN_PLOTS_PERMISSIONS_OPEN_UP_PROGRESSIVELY(
"town_ruining.town_ruins.do_plots_permissions_change_to_allow_all",
"false",
"",
"# If this is true, when a town becomes a ruin, every hour more and more of their plots will have their permissions turned to allow",
TOWN_RUINING_TOWN_DEPOSITS_BANK_TO_NATION(
"town_ruining.town_ruins.town_bank_is_sent_to_nation",
"false",
"",
"# If this is true, when a town becomes a ruin, and they are a member of a nation, any money in the town bank will be deposited to the nation bank."),
TOWN_RUINING_TOWN_PERMISSIONS_ALLOW_ALL(
"town_ruining.town_ruins.do_town_permissions_change_to_allow_all",
"true",
"",
"# If this is true, when a town becomes a ruin, its permissions will be changed to allow all."),
TOWN_RUINING_TOWN_PLOTS_PERMISSIONS_OPEN_UP_PROGRESSIVELY(
"town_ruining.town_ruins.do_plots_permissions_change_to_allow_all",
"false",
"",
"# This setting has no effect when do_town_permissions_change_to_allow_all is false.",
"# If this is true, when a town becomes a ruin, every hour more and more of their plots will have their permissions turned to allow",
"# build, destroy, switch, itemuse to on. This will affect the newest claims first and progress until the first claims made are opened up",
"# right before the max_duration_hours have passed. When a town has more claims than max_duration_hours, multiple plots will be opened up",
"# each hour, ie: 500 claims and 72 max hours = 7 claims per hour.",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3933,6 +3933,10 @@ public static boolean areRuinedTownsBanksPaidToNation() {
return getBoolean(ConfigNodes.TOWN_RUINING_TOWN_DEPOSITS_BANK_TO_NATION);
}

public static boolean doRuinsTownPermissionsAllowAll() {
return getBoolean(ConfigNodes.TOWN_RUINING_TOWN_PERMISSIONS_ALLOW_ALL);
}

public static boolean doRuinsPlotPermissionsProgressivelyAllowAll() {
return getBoolean(ConfigNodes.TOWN_RUINING_TOWN_PLOTS_PERMISSIONS_OPEN_UP_PROGRESSIVELY);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ public static void putTownIntoRuinedState(Town town) {
town.setRuinedTime(System.currentTimeMillis());
town.setPublic(TownySettings.areRuinsMadePublic());
town.setOpen(TownySettings.areRuinsMadeOpen());
town.getPermissions().setAll(true);
if (TownySettings.doRuinsTownPermissionsAllowAll())
town.getPermissions().setAll(true);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

It seems this is correct and plot settings are not preserved. I will do some work on adjusting this to make it so plots are also preserved


//Return town blocks to the basic, unowned, type
for(TownBlock townBlock: town.getTownBlocks()) {
Expand Down Expand Up @@ -284,7 +285,7 @@ public static void evaluateRuinedTownRemovals() {
continue;
}

if (TownySettings.doRuinsPlotPermissionsProgressivelyAllowAll()) {
if (TownySettings.doRuinsTownPermissionsAllowAll() && TownySettings.doRuinsPlotPermissionsProgressivelyAllowAll()) {
final Town finalTown = town;
// We are configured to slowly open up plots' permissions while a town is ruined.
Towny.getPlugin().getScheduler().runAsync(() -> allowPermissionsOnRuinedTownBlocks(finalTown));
Expand Down
Loading