mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 21:26:45 +01:00
Added ignore-if-modified
This commit is contained in:
parent
14ce682a63
commit
ab03b358f5
@ -832,6 +832,7 @@ public class PlotSquared {
|
||||
options.put("clear.fastmode", Settings.ENABLE_CLUSTERS);
|
||||
options.put("clear.auto.clear-interval-seconds", Settings.CLEAR_INTERVAL);
|
||||
options.put("clear.keep-if-modified", Settings.MIN_BLOCKS_CHANGED);
|
||||
options.put("clear.ignore-if-modified", Settings.MIN_BLOCKS_CHANGED_IGNORED);
|
||||
|
||||
// Schematics
|
||||
options.put("schematics.save_path", Settings.SCHEMATIC_SAVE_PATH);
|
||||
@ -913,6 +914,7 @@ public class PlotSquared {
|
||||
Settings.AUTO_CLEAR = config.getBoolean("clear.auto.enabled");
|
||||
Settings.CLEAR_INTERVAL = config.getInt("clear.auto.clear-interval-seconds");
|
||||
Settings.MIN_BLOCKS_CHANGED = config.getInt("clear.keep-if-modified");
|
||||
Settings.MIN_BLOCKS_CHANGED_IGNORED = config.getInt("clear.ignore-if-modified");
|
||||
|
||||
// Schematics
|
||||
Settings.SCHEMATIC_SAVE_PATH = config.getString("schematics.save_path");
|
||||
|
@ -147,6 +147,7 @@ public class Settings {
|
||||
public static int AUTO_CLEAR_DAYS = 360;
|
||||
public static boolean AUTO_CLEAR_CHECK_DISK = false;
|
||||
public static int MIN_BLOCKS_CHANGED = -1;
|
||||
public static int MIN_BLOCKS_CHANGED_IGNORED = -1;
|
||||
public static int CLEAR_INTERVAL = 120;
|
||||
/**
|
||||
* API Location
|
||||
|
@ -126,11 +126,17 @@ public class ExpireManager {
|
||||
@Override
|
||||
public void run() {
|
||||
int changed = (int) this.value;
|
||||
if (changed >= Settings.MIN_BLOCKS_CHANGED && Settings.MIN_BLOCKS_CHANGED > 0) {
|
||||
PlotSquared.log("&aKeep flag added to: " + plot.id + (changed != -1 ? " (changed " + value + ")" : ""));
|
||||
FlagManager.addPlotFlag(plot, new Flag(FlagManager.getFlag("keep"), true));
|
||||
expiredPlots.get(world).remove(plot);
|
||||
return;
|
||||
if (Settings.MIN_BLOCKS_CHANGED_IGNORED > 0 || Settings.MIN_BLOCKS_CHANGED > 0 && manager instanceof ClassicPlotManager) {
|
||||
if (changed >= Settings.MIN_BLOCKS_CHANGED && Settings.MIN_BLOCKS_CHANGED > 0) {
|
||||
PlotSquared.log("&aKeep flag added to: " + plot.id + (changed != -1 ? " (changed " + value + ")" : ""));
|
||||
FlagManager.addPlotFlag(plot, new Flag(FlagManager.getFlag("keep"), true));
|
||||
expiredPlots.get(world).remove(plot);
|
||||
return;
|
||||
}
|
||||
else if (changed >= Settings.MIN_BLOCKS_CHANGED_IGNORED && Settings.MIN_BLOCKS_CHANGED_IGNORED > 0) {
|
||||
expiredPlots.get(world).remove(plot);
|
||||
return;
|
||||
}
|
||||
}
|
||||
manager.clearPlot(plotworld, plot, false, null);
|
||||
MainUtil.removeSign(plot);
|
||||
@ -146,7 +152,7 @@ public class ExpireManager {
|
||||
}
|
||||
}
|
||||
};
|
||||
if (Settings.MIN_BLOCKS_CHANGED > 0 && manager instanceof ClassicPlotManager) {
|
||||
if (Settings.MIN_BLOCKS_CHANGED_IGNORED > 0 || Settings.MIN_BLOCKS_CHANGED > 0 && manager instanceof ClassicPlotManager) {
|
||||
HybridUtils.manager.checkModified(plot, run);
|
||||
}
|
||||
else {
|
||||
|
Loading…
Reference in New Issue
Block a user