diff --git a/Core/src/main/java/com/plotsquared/core/configuration/Settings.java b/Core/src/main/java/com/plotsquared/core/configuration/Settings.java index 6db5f8476..1e24cc1cf 100644 --- a/Core/src/main/java/com/plotsquared/core/configuration/Settings.java +++ b/Core/src/main/java/com/plotsquared/core/configuration/Settings.java @@ -420,6 +420,8 @@ public class Settings extends Config { public static boolean AUTOMATIC_BACKUPS = true; @Comment("Maximum amount of backups associated with a plot") public static int BACKUP_LIMIT = 3; + @Comment("Whether or not backups should be deleted when the plot is unclaimed") + public static boolean DELETE_ON_UNCLAIM = true; } } diff --git a/Core/src/main/java/com/plotsquared/core/plot/Plot.java b/Core/src/main/java/com/plotsquared/core/plot/Plot.java index 0a25e4cdd..e77861b94 100644 --- a/Core/src/main/java/com/plotsquared/core/plot/Plot.java +++ b/Core/src/main/java/com/plotsquared/core/plot/Plot.java @@ -1360,9 +1360,10 @@ public class Plot { PlotListener.plotExit(pp, current); } - // Destroy all backups when the plot is unclaimed - Objects.requireNonNull(PlotSquared.imp()).getBackupManager() - .getProfile(current).destroy(); + if (Settings.Backup.DELETE_ON_UNCLAIM) { + // Destroy all backups when the plot is unclaimed + Objects.requireNonNull(PlotSquared.imp()).getBackupManager().getProfile(current).destroy(); + } getArea().removePlot(getId()); DBFunc.delete(current);