From c0e871a5e3621c6421110a5cbfbaeb3cbf5493ce Mon Sep 17 00:00:00 2001 From: xiaolin Date: Thu, 20 Jun 2024 16:54:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A2=9E=E9=87=8F=E5=A4=87?= =?UTF-8?q?=E4=BB=BD=E4=B8=8B=E7=95=8C=E5=92=8C=E6=9C=AB=E5=9C=B0=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=AD=98=E5=82=A8=E5=88=B0=E9=94=99=E8=AF=AF=E4=BD=8D?= =?UTF-8?q?=E7=BD=AE=20#34=20#32=20#23?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../skydynamic/quickbackupmulti/utils/MakeUtils.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/main/java/dev/skydynamic/quickbackupmulti/utils/MakeUtils.java b/src/main/java/dev/skydynamic/quickbackupmulti/utils/MakeUtils.java index 1334ca8..d767eef 100644 --- a/src/main/java/dev/skydynamic/quickbackupmulti/utils/MakeUtils.java +++ b/src/main/java/dev/skydynamic/quickbackupmulti/utils/MakeUtils.java @@ -2,7 +2,10 @@ import dev.morphia.query.filters.Filters; import dev.skydynamic.quickbackupmulti.config.Config; -import dev.skydynamic.quickbackupmulti.storage.*; +import dev.skydynamic.quickbackupmulti.storage.BackupInfo; +import dev.skydynamic.quickbackupmulti.storage.DimensionFormat; +import dev.skydynamic.quickbackupmulti.storage.FileHashes; +import dev.skydynamic.quickbackupmulti.storage.IndexFile; import net.minecraft.server.MinecraftServer; import net.minecraft.server.command.ServerCommandSource; import net.minecraft.server.world.ServerWorld; @@ -15,8 +18,8 @@ import java.util.*; import static dev.skydynamic.quickbackupmulti.QuickBackupMulti.LOGGER; -import static dev.skydynamic.quickbackupmulti.i18n.Translate.tr; import static dev.skydynamic.quickbackupmulti.QuickBackupMulti.getDataBase; +import static dev.skydynamic.quickbackupmulti.i18n.Translate.tr; import static dev.skydynamic.quickbackupmulti.utils.QbmManager.*; import static dev.skydynamic.quickbackupmulti.utils.ScheduleUtils.startSchedule; import static dev.skydynamic.quickbackupmulti.utils.hash.HashUtils.compareFileHash; @@ -168,12 +171,14 @@ public static int make(ServerCommandSource commandSource, String name, String de if (file.getName().equals("DIM1") || file.getName().equals("DIM-1")) { // 如果是文件夹(原版情况下一般只有文件夹了xwx, 但还是要判断) if (dirFile.isDirectory()) { + // 使用DIM的目标文件夹 + File dimDestDir = getBackupDir().resolve(name + "/" + file.getName()).toFile(); // 初始化 hashMap = new HashMap<>(); indexMap = new HashMap<>(); for (File dirFile1 : dirFile.listFiles()) { // 该处同root与别的文件夹 - HashMap resultMap = compareAndIndex(firstBackup, latestBackupName, fileHashedDocument, indexFileDocument, dirFile1, destDir, hashMap, indexMap, indexBackupList); + HashMap resultMap = compareAndIndex(firstBackup, latestBackupName, fileHashedDocument, indexFileDocument, dirFile1, dimDestDir, hashMap, indexMap, indexBackupList); hashMap = (HashMap) resultMap.get("hash"); indexMap = (HashMap) resultMap.get("index"); indexBackupList = (List) resultMap.get("indexBackupList");