mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 15:16: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.fastmode", Settings.ENABLE_CLUSTERS);
|
||||||
options.put("clear.auto.clear-interval-seconds", Settings.CLEAR_INTERVAL);
|
options.put("clear.auto.clear-interval-seconds", Settings.CLEAR_INTERVAL);
|
||||||
options.put("clear.keep-if-modified", Settings.MIN_BLOCKS_CHANGED);
|
options.put("clear.keep-if-modified", Settings.MIN_BLOCKS_CHANGED);
|
||||||
|
options.put("clear.ignore-if-modified", Settings.MIN_BLOCKS_CHANGED_IGNORED);
|
||||||
|
|
||||||
// Schematics
|
// Schematics
|
||||||
options.put("schematics.save_path", Settings.SCHEMATIC_SAVE_PATH);
|
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.AUTO_CLEAR = config.getBoolean("clear.auto.enabled");
|
||||||
Settings.CLEAR_INTERVAL = config.getInt("clear.auto.clear-interval-seconds");
|
Settings.CLEAR_INTERVAL = config.getInt("clear.auto.clear-interval-seconds");
|
||||||
Settings.MIN_BLOCKS_CHANGED = config.getInt("clear.keep-if-modified");
|
Settings.MIN_BLOCKS_CHANGED = config.getInt("clear.keep-if-modified");
|
||||||
|
Settings.MIN_BLOCKS_CHANGED_IGNORED = config.getInt("clear.ignore-if-modified");
|
||||||
|
|
||||||
// Schematics
|
// Schematics
|
||||||
Settings.SCHEMATIC_SAVE_PATH = config.getString("schematics.save_path");
|
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 int AUTO_CLEAR_DAYS = 360;
|
||||||
public static boolean AUTO_CLEAR_CHECK_DISK = false;
|
public static boolean AUTO_CLEAR_CHECK_DISK = false;
|
||||||
public static int MIN_BLOCKS_CHANGED = -1;
|
public static int MIN_BLOCKS_CHANGED = -1;
|
||||||
|
public static int MIN_BLOCKS_CHANGED_IGNORED = -1;
|
||||||
public static int CLEAR_INTERVAL = 120;
|
public static int CLEAR_INTERVAL = 120;
|
||||||
/**
|
/**
|
||||||
* API Location
|
* API Location
|
||||||
|
@ -126,12 +126,18 @@ public class ExpireManager {
|
|||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
int changed = (int) this.value;
|
int changed = (int) this.value;
|
||||||
|
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) {
|
if (changed >= Settings.MIN_BLOCKS_CHANGED && Settings.MIN_BLOCKS_CHANGED > 0) {
|
||||||
PlotSquared.log("&aKeep flag added to: " + plot.id + (changed != -1 ? " (changed " + value + ")" : ""));
|
PlotSquared.log("&aKeep flag added to: " + plot.id + (changed != -1 ? " (changed " + value + ")" : ""));
|
||||||
FlagManager.addPlotFlag(plot, new Flag(FlagManager.getFlag("keep"), true));
|
FlagManager.addPlotFlag(plot, new Flag(FlagManager.getFlag("keep"), true));
|
||||||
expiredPlots.get(world).remove(plot);
|
expiredPlots.get(world).remove(plot);
|
||||||
return;
|
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);
|
manager.clearPlot(plotworld, plot, false, null);
|
||||||
MainUtil.removeSign(plot);
|
MainUtil.removeSign(plot);
|
||||||
DBFunc.delete(world, plot);
|
DBFunc.delete(world, 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);
|
HybridUtils.manager.checkModified(plot, run);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
Reference in New Issue
Block a user