Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically update maxDepth #1871

Merged
merged 2 commits into from May 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -407,6 +407,7 @@ private void loadConfig()
outConfig.options().header("Default values are perfect for most servers. If you want to customize and have a question, look for the answer here first: http://dev.bukkit.org/bukkit-plugins/grief-prevention/pages/setup-and-configuration/");

//read configuration settings (note defaults)
int configVersion = config.getInt("GriefPrevention.ConfigVersion", 0);

//get (deprecated node) claims world names from the config file
List<World> worlds = this.getServer().getWorlds();
Expand Down Expand Up @@ -558,6 +559,12 @@ else if (world.getEnvironment() == Environment.NORMAL)
this.config_claims_minWidth = config.getInt("GriefPrevention.Claims.MinimumWidth", 5);
this.config_claims_minArea = config.getInt("GriefPrevention.Claims.MinimumArea", 100);
this.config_claims_maxDepth = config.getInt("GriefPrevention.Claims.MaximumDepth", Integer.MIN_VALUE);
if (configVersion < 1 && this.config_claims_maxDepth == 0)
{
// If MaximumDepth is untouched in an older configuration, correct it.
this.config_claims_maxDepth = Integer.MIN_VALUE;
AddLogEntry("Updated default value for GriefPrevention.Claims.MaximumDepth to " + Integer.MIN_VALUE);
}
this.config_claims_chestClaimExpirationDays = config.getInt("GriefPrevention.Claims.Expiration.ChestClaimDays", 7);
this.config_claims_unusedClaimExpirationDays = config.getInt("GriefPrevention.Claims.Expiration.UnusedClaimDays", 14);
this.config_claims_expirationDays = config.getInt("GriefPrevention.Claims.Expiration.AllClaims.DaysInactive", 60);
Expand Down Expand Up @@ -911,6 +918,7 @@ else if (world.getEnvironment() == Environment.NORMAL)
outConfig.set("GriefPrevention.Abridged Logs.Included Entry Types.Administrative Activity", this.config_logs_adminEnabled);
outConfig.set("GriefPrevention.Abridged Logs.Included Entry Types.Debug", this.config_logs_debugEnabled);
outConfig.set("GriefPrevention.Abridged Logs.Included Entry Types.Muted Chat Messages", this.config_logs_mutedChatEnabled);
outConfig.set("GriefPrevention.ConfigVersion", 1);

try
{
Expand Down