From cf3078259b4d4b3bf3e006d8845176789399848d Mon Sep 17 00:00:00 2001 From: Szum123321 Date: Tue, 27 Dec 2022 15:35:03 +0100 Subject: [PATCH] bugfixes --- gradle.properties | 17 ++++++++--------- .../textile_backup/config/ConfigPOJO.java | 5 +++-- .../textile_backup/core/CompressionStatus.java | 2 +- .../core/restore/RestoreBackupRunnable.java | 5 +++++ .../assets/textile_backup/lang/en_us.json | 4 ++-- 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/gradle.properties b/gradle.properties index 993b3d3..eb61004 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,26 +1,25 @@ # Done to increase the memory available to gradle. org.gradle.jvmargs=-Xmx1G -minecraft_version=1.19.2 -yarn_mappings=1.19.2+build.28 -loader_version=0.14.10 +minecraft_version=1.19.3 +yarn_mappings=1.19.3+build.3 +loader_version=0.14.11 #Fabric api -fabric_version=0.67.1+1.19.2 +fabric_version=0.69.1+1.19.3 #Cloth Config -cloth_version=8.2.88 +cloth_version=9.0.94 #ModMenu -modmenu_version=4.1.0 +modmenu_version=5.0.2 -#Lazy DFU for faster dev start -lazydfu_version=v0.1.3 +databreaker_version=0.2.10 #Hash of commit form which parallel gzip will be build pgzip_commit_hash=af5f5c297e735f3f2df7aa4eb0e19a5810b8aff6 # Mod Properties -mod_version = 3.0.0-a +mod_version = 3.0.0-b maven_group = net.szum123321 archives_base_name = textile_backup \ No newline at end of file diff --git a/src/main/java/net/szum123321/textile_backup/config/ConfigPOJO.java b/src/main/java/net/szum123321/textile_backup/config/ConfigPOJO.java index af9d410..0cec14a 100644 --- a/src/main/java/net/szum123321/textile_backup/config/ConfigPOJO.java +++ b/src/main/java/net/szum123321/textile_backup/config/ConfigPOJO.java @@ -24,6 +24,7 @@ import me.shedaniel.autoconfig.annotation.Config; import me.shedaniel.autoconfig.annotation.ConfigEntry; import me.shedaniel.cloth.clothconfig.shadowed.blue.endless.jankson.Comment; import net.szum123321.textile_backup.TextileBackup; +import net.szum123321.textile_backup.core.create.compressors.AbstractCompressor; import java.time.format.DateTimeFormatter; import java.util.*; @@ -199,8 +200,8 @@ public class ConfigPOJO implements ConfigData { public enum ArchiveFormat { ZIP("zip"), GZIP("tar", "gz"), - BZIP2("tar", "bz2"), - LZMA("tar", "xz"), + //BZIP2("tar", "bz2"), + //LZMA("tar", "xz"), TAR("tar"); private final List extensionPieces; diff --git a/src/main/java/net/szum123321/textile_backup/core/CompressionStatus.java b/src/main/java/net/szum123321/textile_backup/core/CompressionStatus.java index 7ca0cfc..af2d3c9 100644 --- a/src/main/java/net/szum123321/textile_backup/core/CompressionStatus.java +++ b/src/main/java/net/szum123321/textile_backup/core/CompressionStatus.java @@ -37,7 +37,7 @@ public record CompressionStatus(long treeHash, Map brokenFiles, if(!brokenFiles.isEmpty()) return Optional.of("Damaged files present! ^"); - if(ctx.restoreableFile().getCreationTime() != date) + if(ctx.restoreableFile().getCreationTime().equals(date)) return Optional.of( "Creation date mismatch!\n Expected: " + date.format(DateTimeFormatter.ISO_DATE_TIME) + ", got: " + diff --git a/src/main/java/net/szum123321/textile_backup/core/restore/RestoreBackupRunnable.java b/src/main/java/net/szum123321/textile_backup/core/restore/RestoreBackupRunnable.java index cd1135b..6f705eb 100644 --- a/src/main/java/net/szum123321/textile_backup/core/restore/RestoreBackupRunnable.java +++ b/src/main/java/net/szum123321/textile_backup/core/restore/RestoreBackupRunnable.java @@ -30,6 +30,7 @@ import net.szum123321.textile_backup.core.create.BackupContext; import net.szum123321.textile_backup.core.create.MakeBackupRunnableFactory; import net.szum123321.textile_backup.core.restore.decompressors.GenericTarDecompressor; import net.szum123321.textile_backup.core.restore.decompressors.ZipDecompressor; +import net.szum123321.textile_backup.mixin.MinecraftServerSessionAccessor; import java.io.IOException; import java.nio.file.Files; @@ -126,6 +127,9 @@ public class RestoreBackupRunnable implements Runnable { if (errorMsg.isEmpty()) log.info("Backup valid. Restoring"); else log.info("Backup is damaged, but verification is disabled [{}]. Restoring", errorMsg.get()); + ((MinecraftServerSessionAccessor) ctx.server()) + .getSession().close(); + Utilities.deleteDirectory(worldFile); Files.move(tmp, worldFile); @@ -136,6 +140,7 @@ public class RestoreBackupRunnable implements Runnable { } else { log.error(errorMsg.get()); } + } catch (Exception e) { log.error("An exception occurred while trying to restore a backup!", e); } finally { diff --git a/src/main/resources/assets/textile_backup/lang/en_us.json b/src/main/resources/assets/textile_backup/lang/en_us.json index 9846353..39b3aa3 100644 --- a/src/main/resources/assets/textile_backup/lang/en_us.json +++ b/src/main/resources/assets/textile_backup/lang/en_us.json @@ -47,8 +47,8 @@ "text.autoconfig.textile_backup.option.format": "Archive and compression format", "text.autoconfig.textile_backup.option.format.@Tooltip": "See: https://github.com/Szum123321/textile_backup/wiki/Configuration#format", - "text.autoconfig.textile_backup.option.integrityVerificationMode": "Verify the backup file has not been damaged", - "text.autoconfig.textile_backup.option.integrityVerificationMode.@Tooltip": "DO NOT ALTER unless fully certain", + "text.autoconfig.textile_backup.option.integrityVerificationMode": "Verify backup integrity", + "text.autoconfig.textile_backup.option.integrityVerificationMode.@Tooltip": "DO NOT ALTER unless fully aware of consequences", "text.autoconfig.textile_backup.option.permissionLevel": "Min permission level",