Skip to content

Commit 41ef61e

Browse files
committed
Saving world before making backup added.
Ugly backup file name fixed. Signed-off-by: Pavel Erokhin (MairwunNx) <MairwunNx@gmail.com>
1 parent 39bcb49 commit 41ef61e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main/kotlin/com/mairwunnx/projectessentials/backup/BackupController.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ object BackupController {
104104
private fun makeBackup(path: String) {
105105
val configuration = BackupConfigurationController.get()
106106

107+
EntryPoint.serverInstance.save(true, false, true)
108+
107109
ZipUtil.pack(
108110
File(path),
109111
File(buildFilePathName(path)),
@@ -121,9 +123,9 @@ object BackupController {
121123

122124
return if (path.contains(File.separator)) {
123125
val worldName = path.split(File.separator)[1]
124-
backupDirectory + File.separator + worldName + currentDateTime + extension
126+
backupDirectory + File.separator + worldName + "-" + currentDateTime + extension
125127
} else {
126-
backupDirectory + File.separator + path + currentDateTime + extension
128+
backupDirectory + File.separator + path + "-" + currentDateTime + extension
127129
}
128130
}
129131
}

0 commit comments

Comments
 (0)