Added missing import, removed duplicate method

56-bugfix
szymon 2020-11-30 10:34:20 +01:00
parent 5d7aaf1938
commit 2de5f4c80b
2 changed files with 2 additions and 13 deletions

View File

@ -33,6 +33,7 @@ import net.szum123321.textile_backup.commands.permission.WhitelistCommand;
import net.szum123321.textile_backup.commands.restore.KillRestoreCommand; import net.szum123321.textile_backup.commands.restore.KillRestoreCommand;
import net.szum123321.textile_backup.commands.restore.ListBackupsCommand; import net.szum123321.textile_backup.commands.restore.ListBackupsCommand;
import net.szum123321.textile_backup.commands.restore.RestoreBackupCommand; import net.szum123321.textile_backup.commands.restore.RestoreBackupCommand;
import net.szum123321.textile_backup.core.Utilities;
import net.szum123321.textile_backup.core.create.BackupContext; import net.szum123321.textile_backup.core.create.BackupContext;
import net.szum123321.textile_backup.core.create.BackupHelper; import net.szum123321.textile_backup.core.create.BackupHelper;
@ -64,6 +65,7 @@ public class TextileBackup implements ModInitializer {
if(Statics.CONFIG.backupInterval > 0) if(Statics.CONFIG.backupInterval > 0)
ServerTickEvents.END_SERVER_TICK.register(Statics.scheduler::tick); ServerTickEvents.END_SERVER_TICK.register(Statics.scheduler::tick);
//Restart Executor Service in singleplayer
ServerLifecycleEvents.SERVER_STARTING.register(ignored -> { ServerLifecycleEvents.SERVER_STARTING.register(ignored -> {
if(Statics.executorService.isShutdown()) if(Statics.executorService.isShutdown())
Statics.executorService = Executors.newSingleThreadExecutor(); Statics.executorService = Executors.newSingleThreadExecutor();

View File

@ -160,19 +160,6 @@ public class Utilities {
return Optional.ofNullable(creationTime); return Optional.ofNullable(creationTime);
} }
public static File getBackupRootPath(String worldName) {
File path = new File(Statics.CONFIG.path).getAbsoluteFile();
if (Statics.CONFIG.perWorldBackup)
path = path.toPath().resolve(worldName).toFile();
if (!path.exists()) {
path.mkdirs();
}
return path;
}
public static boolean isValidBackup(File f) { public static boolean isValidBackup(File f) {
return getArchiveExtension(f).isPresent() && getFileCreationTime(f).isPresent() && isFileOk(f); return getArchiveExtension(f).isPresent() && getFileCreationTime(f).isPresent() && isFileOk(f);
} }