Add option to disable deletion of plot backups when the plot is unclaimed

This commit is contained in:
Alexander Söderberg 2020-05-10 21:52:57 +02:00
parent 658361f825
commit fc74c582bf
No known key found for this signature in database
GPG Key ID: C0207FF7EA146678
2 changed files with 6 additions and 3 deletions

View File

@ -420,6 +420,8 @@ public class Settings extends Config {
public static boolean AUTOMATIC_BACKUPS = true; public static boolean AUTOMATIC_BACKUPS = true;
@Comment("Maximum amount of backups associated with a plot") @Comment("Maximum amount of backups associated with a plot")
public static int BACKUP_LIMIT = 3; 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;
} }
} }

View File

@ -1360,9 +1360,10 @@ public class Plot {
PlotListener.plotExit(pp, current); PlotListener.plotExit(pp, current);
} }
// Destroy all backups when the plot is unclaimed if (Settings.Backup.DELETE_ON_UNCLAIM) {
Objects.requireNonNull(PlotSquared.imp()).getBackupManager() // Destroy all backups when the plot is unclaimed
.getProfile(current).destroy(); Objects.requireNonNull(PlotSquared.imp()).getBackupManager().getProfile(current).destroy();
}
getArea().removePlot(getId()); getArea().removePlot(getId());
DBFunc.delete(current); DBFunc.delete(current);