mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-11-04 03:03:43 +01:00 
			
		
		
		
	Added ignore-if-modified
This commit is contained in:
		@@ -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,11 +126,17 @@ public class ExpireManager {
 | 
				
			|||||||
                        @Override
 | 
					                        @Override
 | 
				
			||||||
                        public void run() {
 | 
					                        public void run() {
 | 
				
			||||||
                            int changed = (int) this.value;
 | 
					                            int changed = (int) this.value;
 | 
				
			||||||
                            if (changed >= Settings.MIN_BLOCKS_CHANGED && Settings.MIN_BLOCKS_CHANGED > 0) {
 | 
					                            if (Settings.MIN_BLOCKS_CHANGED_IGNORED > 0 || Settings.MIN_BLOCKS_CHANGED > 0 && manager instanceof ClassicPlotManager) {
 | 
				
			||||||
                                PlotSquared.log("&aKeep flag added to: " + plot.id + (changed != -1 ? " (changed " + value + ")" : ""));
 | 
					                                if (changed >= Settings.MIN_BLOCKS_CHANGED && Settings.MIN_BLOCKS_CHANGED > 0) {
 | 
				
			||||||
                                FlagManager.addPlotFlag(plot, new Flag(FlagManager.getFlag("keep"), true));
 | 
					                                    PlotSquared.log("&aKeep flag added to: " + plot.id + (changed != -1 ? " (changed " + value + ")" : ""));
 | 
				
			||||||
                                expiredPlots.get(world).remove(plot);
 | 
					                                    FlagManager.addPlotFlag(plot, new Flag(FlagManager.getFlag("keep"), true));
 | 
				
			||||||
                                return;
 | 
					                                    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);
 | 
					                            manager.clearPlot(plotworld, plot, false, null);
 | 
				
			||||||
                            MainUtil.removeSign(plot);
 | 
					                            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);
 | 
					                        HybridUtils.manager.checkModified(plot, run);
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    else {
 | 
					                    else {
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user