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;
@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;
}
}

View file

@ -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);