Removed option to disable auto cleanup in creative mode.

Disabling this results in a big time opportunity for griefers, who can
just move their land claims around to build without limits.  Now it is
always on, so any builds left behind will vanish.
This commit is contained in:
ryanhamshire 2014-10-13 13:50:48 -07:00
parent f7e24cd660
commit ac657d8a5f
2 changed files with 2 additions and 8 deletions

View File

@ -84,7 +84,6 @@ public class GriefPrevention extends JavaPlugin
public boolean config_claims_creationRequiresPermission; //whether creating claims with the shovel requires a permission
public int config_claims_claimsExtendIntoGroundDistance; //how far below the shoveled block a new claim will reach
public int config_claims_minSize; //minimum width and height for non-admin claims
public boolean config_claims_autoRestoreUnclaimedCreativeLand; //whether unclaimed land in creative worlds is automatically /restorenature-d
public int config_claims_chestClaimExpirationDays; //number of days of inactivity before an automatic chest claim will be deleted
public int config_claims_unusedClaimExpirationDays; //number of days of inactivity before an unused (nothing build) claim will be deleted
@ -308,7 +307,6 @@ public class GriefPrevention extends JavaPlugin
this.config_claims_maxDepth = config.getInt("GriefPrevention.Claims.MaximumDepth", 0);
this.config_claims_trappedCooldownHours = config.getInt("GriefPrevention.Claims.TrappedCommandCooldownHours", 8);
this.config_claims_warnOnBuildOutside = config.getBoolean("GriefPrevention.Claims.WarnWhenBuildingOutsideClaims", true);
this.config_claims_autoRestoreUnclaimedCreativeLand = config.getBoolean("GriefPrevention.Claims.AutoRestoreUnclaimedCreativeLand", true);
this.config_claims_chestClaimExpirationDays = config.getInt("GriefPrevention.Claims.Expiration.ChestClaimDays", 7);
outConfig.set("GriefPrevention.Claims.Expiration.ChestClaimDays", this.config_claims_chestClaimExpirationDays);
@ -322,9 +320,6 @@ public class GriefPrevention extends JavaPlugin
this.config_claims_survivalAutoNatureRestoration = config.getBoolean("GriefPrevention.Claims.Expiration.AutomaticNatureRestoration.SurvivalWorlds", false);
outConfig.set("GriefPrevention.Claims.Expiration.AutomaticNatureRestoration.SurvivalWorlds", this.config_claims_survivalAutoNatureRestoration);
this.config_claims_creativeAutoNatureRestoration = config.getBoolean("GriefPrevention.Claims.Expiration.AutomaticNatureRestoration.CreativeWorlds", true);
outConfig.set("GriefPrevention.Claims.Expiration.AutomaticNatureRestoration.CreativeWorlds", this.config_claims_creativeAutoNatureRestoration);
this.config_spam_enabled = config.getBoolean("GriefPrevention.Spam.Enabled", true);
this.config_spam_loginCooldownSeconds = config.getInt("GriefPrevention.Spam.LoginCooldownSeconds", 60);
this.config_spam_warningMessage = config.getString("GriefPrevention.Spam.WarningMessage", "Please reduce your noise level. Spammers will be banned.");
@ -566,7 +561,6 @@ public class GriefPrevention extends JavaPlugin
outConfig.set("GriefPrevention.Claims.InvestigationTool", this.config_claims_investigationTool.name());
outConfig.set("GriefPrevention.Claims.ModificationTool", this.config_claims_modificationTool.name());
outConfig.set("GriefPrevention.Claims.WarnWhenBuildingOutsideClaims", this.config_claims_warnOnBuildOutside);
outConfig.set("GriefPrevention.Claims.AutoRestoreUnclaimedCreativeLand", this.config_claims_autoRestoreUnclaimedCreativeLand);
outConfig.set("GriefPrevention.Spam.Enabled", this.config_spam_enabled);
outConfig.set("GriefPrevention.Spam.LoginCooldownSeconds", this.config_spam_loginCooldownSeconds);
@ -1440,7 +1434,7 @@ public class GriefPrevention extends JavaPlugin
this.dataStore.deleteClaim(claim);
//if in a creative mode world, /restorenature the claim
if(GriefPrevention.instance.config_claims_autoRestoreUnclaimedCreativeLand && GriefPrevention.instance.creativeRulesApply(claim.getLesserBoundaryCorner()))
if(GriefPrevention.instance.creativeRulesApply(claim.getLesserBoundaryCorner()))
{
GriefPrevention.instance.restoreClaim(claim, 0);
}

View File

@ -1602,7 +1602,7 @@ class PlayerEventHandler implements Listener
}
//if in a creative mode world and shrinking an existing claim, restore any unclaimed area
if(smaller && GriefPrevention.instance.config_claims_autoRestoreUnclaimedCreativeLand && GriefPrevention.instance.creativeRulesApply(oldClaim.getLesserBoundaryCorner()))
if(smaller && GriefPrevention.instance.creativeRulesApply(oldClaim.getLesserBoundaryCorner()))
{
GriefPrevention.sendMessage(player, TextMode.Warn, Messages.UnclaimCleanupWarning);
GriefPrevention.instance.restoreClaim(oldClaim, 20L * 60 * 2); //2 minutes