This was stupid
This commit is contained in:
parent
33f01e8189
commit
bf5f046985
@ -36,6 +36,4 @@ public class Statics {
|
||||
public static boolean disableWatchdog = false;
|
||||
public static AwaitThread restoreAwaitThread = null;
|
||||
public static Optional<File> untouchableFile = Optional.empty();
|
||||
|
||||
public static boolean tmpAvailable;
|
||||
}
|
||||
|
@ -38,7 +38,6 @@ import net.szum123321.textile_backup.commands.restore.RestoreBackupCommand;
|
||||
import net.szum123321.textile_backup.config.ConfigHelper;
|
||||
import net.szum123321.textile_backup.config.ConfigPOJO;
|
||||
import net.szum123321.textile_backup.core.ActionInitiator;
|
||||
import net.szum123321.textile_backup.core.Utilities;
|
||||
import net.szum123321.textile_backup.core.create.BackupContext;
|
||||
import net.szum123321.textile_backup.core.create.BackupHelper;
|
||||
import net.szum123321.textile_backup.core.create.BackupScheduler;
|
||||
@ -58,17 +57,6 @@ public class TextileBackup implements ModInitializer {
|
||||
|
||||
ConfigHelper.updateInstance(AutoConfig.register(ConfigPOJO.class, JanksonConfigSerializer::new));
|
||||
|
||||
//TODO: finish writing wiki
|
||||
if(config.get().format == ConfigPOJO.ArchiveFormat.ZIP) {
|
||||
Statics.tmpAvailable = Utilities.isTmpAvailable();
|
||||
if(!Statics.tmpAvailable) {
|
||||
log.warn("""
|
||||
WARNING! It seems like the temporary folder is not accessible on this system!
|
||||
This will cause problems with multithreaded zip compression, so a normal one will be used instead.
|
||||
For more info please read: https://github.com/Szum123321/textile_backup/wiki/ZIP-Problems""");
|
||||
}
|
||||
}
|
||||
|
||||
ServerTickEvents.END_SERVER_TICK.register(new BackupScheduler()::tick);
|
||||
|
||||
//Restart Executor Service in singleplayer
|
||||
|
@ -59,16 +59,6 @@ public class Utilities {
|
||||
return path;
|
||||
}
|
||||
|
||||
//This is quite pointless
|
||||
public static boolean isTmpAvailable() {
|
||||
try {
|
||||
File tmp = File.createTempFile("textile_backup_tmp_test", String.valueOf(Instant.now().getEpochSecond()));
|
||||
return tmp.delete();
|
||||
} catch (IOException ignored) {}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void disableWorldSaving(MinecraftServer server) {
|
||||
for (ServerWorld serverWorld : server.getWorlds()) {
|
||||
if (serverWorld != null && !serverWorld.savingDisabled)
|
||||
|
@ -90,7 +90,7 @@ public class MakeBackupRunnable implements Runnable {
|
||||
|
||||
switch (config.get().format) {
|
||||
case ZIP -> {
|
||||
if (Statics.tmpAvailable && coreCount > 1)
|
||||
if (coreCount > 1)
|
||||
ParallelZipCompressor.getInstance().createArchive(world, outFile, context, coreCount);
|
||||
else
|
||||
ZipCompressor.getInstance().createArchive(world, outFile, context, coreCount);
|
||||
|
Loading…
Reference in New Issue
Block a user