This commit is contained in:
Szum123321 2022-12-27 15:35:03 +01:00
parent 7d31e6710c
commit cf3078259b
5 changed files with 19 additions and 14 deletions

View File

@ -1,26 +1,25 @@
# Done to increase the memory available to gradle. # Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G org.gradle.jvmargs=-Xmx1G
minecraft_version=1.19.2 minecraft_version=1.19.3
yarn_mappings=1.19.2+build.28 yarn_mappings=1.19.3+build.3
loader_version=0.14.10 loader_version=0.14.11
#Fabric api #Fabric api
fabric_version=0.67.1+1.19.2 fabric_version=0.69.1+1.19.3
#Cloth Config #Cloth Config
cloth_version=8.2.88 cloth_version=9.0.94
#ModMenu #ModMenu
modmenu_version=4.1.0 modmenu_version=5.0.2
#Lazy DFU for faster dev start databreaker_version=0.2.10
lazydfu_version=v0.1.3
#Hash of commit form which parallel gzip will be build #Hash of commit form which parallel gzip will be build
pgzip_commit_hash=af5f5c297e735f3f2df7aa4eb0e19a5810b8aff6 pgzip_commit_hash=af5f5c297e735f3f2df7aa4eb0e19a5810b8aff6
# Mod Properties # Mod Properties
mod_version = 3.0.0-a mod_version = 3.0.0-b
maven_group = net.szum123321 maven_group = net.szum123321
archives_base_name = textile_backup archives_base_name = textile_backup

View File

@ -24,6 +24,7 @@ import me.shedaniel.autoconfig.annotation.Config;
import me.shedaniel.autoconfig.annotation.ConfigEntry; import me.shedaniel.autoconfig.annotation.ConfigEntry;
import me.shedaniel.cloth.clothconfig.shadowed.blue.endless.jankson.Comment; import me.shedaniel.cloth.clothconfig.shadowed.blue.endless.jankson.Comment;
import net.szum123321.textile_backup.TextileBackup; import net.szum123321.textile_backup.TextileBackup;
import net.szum123321.textile_backup.core.create.compressors.AbstractCompressor;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.util.*; import java.util.*;
@ -199,8 +200,8 @@ public class ConfigPOJO implements ConfigData {
public enum ArchiveFormat { public enum ArchiveFormat {
ZIP("zip"), ZIP("zip"),
GZIP("tar", "gz"), GZIP("tar", "gz"),
BZIP2("tar", "bz2"), //BZIP2("tar", "bz2"),
LZMA("tar", "xz"), //LZMA("tar", "xz"),
TAR("tar"); TAR("tar");
private final List<String> extensionPieces; private final List<String> extensionPieces;

View File

@ -37,7 +37,7 @@ public record CompressionStatus(long treeHash, Map<Path, Exception> brokenFiles,
if(!brokenFiles.isEmpty()) if(!brokenFiles.isEmpty())
return Optional.of("Damaged files present! ^"); return Optional.of("Damaged files present! ^");
if(ctx.restoreableFile().getCreationTime() != date) if(ctx.restoreableFile().getCreationTime().equals(date))
return Optional.of( return Optional.of(
"Creation date mismatch!\n Expected: " + "Creation date mismatch!\n Expected: " +
date.format(DateTimeFormatter.ISO_DATE_TIME) + ", got: " + date.format(DateTimeFormatter.ISO_DATE_TIME) + ", got: " +

View File

@ -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.create.MakeBackupRunnableFactory;
import net.szum123321.textile_backup.core.restore.decompressors.GenericTarDecompressor; import net.szum123321.textile_backup.core.restore.decompressors.GenericTarDecompressor;
import net.szum123321.textile_backup.core.restore.decompressors.ZipDecompressor; import net.szum123321.textile_backup.core.restore.decompressors.ZipDecompressor;
import net.szum123321.textile_backup.mixin.MinecraftServerSessionAccessor;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Files; import java.nio.file.Files;
@ -126,6 +127,9 @@ public class RestoreBackupRunnable implements Runnable {
if (errorMsg.isEmpty()) log.info("Backup valid. Restoring"); if (errorMsg.isEmpty()) log.info("Backup valid. Restoring");
else log.info("Backup is damaged, but verification is disabled [{}]. Restoring", errorMsg.get()); else log.info("Backup is damaged, but verification is disabled [{}]. Restoring", errorMsg.get());
((MinecraftServerSessionAccessor) ctx.server())
.getSession().close();
Utilities.deleteDirectory(worldFile); Utilities.deleteDirectory(worldFile);
Files.move(tmp, worldFile); Files.move(tmp, worldFile);
@ -136,6 +140,7 @@ public class RestoreBackupRunnable implements Runnable {
} else { } else {
log.error(errorMsg.get()); log.error(errorMsg.get());
} }
} catch (Exception e) { } catch (Exception e) {
log.error("An exception occurred while trying to restore a backup!", e); log.error("An exception occurred while trying to restore a backup!", e);
} finally { } finally {

View File

@ -47,8 +47,8 @@
"text.autoconfig.textile_backup.option.format": "Archive and compression format", "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.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": "Verify backup integrity",
"text.autoconfig.textile_backup.option.integrityVerificationMode.@Tooltip": "DO NOT ALTER unless fully certain", "text.autoconfig.textile_backup.option.integrityVerificationMode.@Tooltip": "DO NOT ALTER unless fully aware of consequences",
"text.autoconfig.textile_backup.option.permissionLevel": "Min permission level", "text.autoconfig.textile_backup.option.permissionLevel": "Min permission level",