Skip to content

Commit

Permalink
custom-named backups should be deleted by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyfts committed Aug 3, 2024
1 parent 3cfa172 commit 6c5e812
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/main/java/serverutils/ServerUtilitiesConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,15 @@ public static boolean sync() {
"max_folder_size",
0,
"""
Max size of backup folder in GB. If total folder size exceeds this value it will delete old backups until the size is under.
Max size of backup folder in GB. If total folder size exceeds this value old backups will be deleted until the size is under.
0 = Disabled and backups_to_keep will be used instead.""")
.getInt();
backups.delete_custom_name_backups = config.get(
BACKUPS,
"delete_custom_name_backups",
false,
"Delete backups that have a custom name set through /backup start <name>").getBoolean();
true,
"Include backups that have a custom name set through /backup start <name> when deleting old backups")
.getBoolean();

chat.add_nickname_tilde = config.get(
CHAT,
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/serverutils/task/backup/BackupTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import net.minecraft.command.ICommandSender;
import net.minecraft.server.MinecraftServer;
import net.minecraft.world.WorldServer;
import net.minecraftforge.common.DimensionManager;

import serverutils.ServerUtilities;
import serverutils.ServerUtilitiesConfig;
Expand Down Expand Up @@ -94,7 +95,7 @@ public void execute(Universe universe) {
ServerUtilities.LOGGER.info("An error occurred while turning off auto-save.", ex);
}

File worldDir = server.getEntityWorld().getSaveHandler().getWorldDirectory();
File worldDir = DimensionManager.getCurrentSaveRootDirectory();

if (backups.use_separate_thread) {
thread = new ThreadBackup(worldDir, customName);
Expand Down

0 comments on commit 6c5e812

Please sign in to comment.