Few final tweaks. Everything seems to be working alright.
parent
19349e3775
commit
b01d22e4c8
|
@ -9,6 +9,6 @@ loader_version=0.8.2+build.194
|
||||||
fabric_version=0.5.1+build.294-1.15
|
fabric_version=0.5.1+build.294-1.15
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 1.2.0S-1.15
|
mod_version = 1.2.0-1.15
|
||||||
maven_group = net.szum123321
|
maven_group = net.szum123321
|
||||||
archives_base_name = textile_backup
|
archives_base_name = textile_backup
|
|
@ -27,60 +27,60 @@ import java.util.Set;
|
||||||
@ConfigFile(name = TextileBackup.MOD_ID)
|
@ConfigFile(name = TextileBackup.MOD_ID)
|
||||||
public class ConfigHandler {
|
public class ConfigHandler {
|
||||||
@Comment("\nTime between backups in seconds\n")
|
@Comment("\nTime between backups in seconds\n")
|
||||||
public final long backupInterval = 3600;
|
public long backupInterval = 3600;
|
||||||
|
|
||||||
@Comment("\nShould backups be done even if there is no players?\n")
|
@Comment("\nShould backups be done even if there is no players?\n")
|
||||||
public final boolean doBackupsOnEmptyServer = false;
|
public boolean doBackupsOnEmptyServer = false;
|
||||||
|
|
||||||
@Comment("\nShould backups be made on server shutdown\n")
|
@Comment("\nShould backups be made on server shutdown\n")
|
||||||
public final boolean shutdownBackup = true;
|
public boolean shutdownBackup = true;
|
||||||
|
|
||||||
@Comment("\nA path to backup folder\n")
|
@Comment("\nA path to backup folder\n")
|
||||||
public final String path = "backup/";
|
public String path = "backup/";
|
||||||
|
|
||||||
@Comment("\nThis setting allows you to exclude files form being backuped.\n"+
|
@Comment("\nThis setting allows you to exclude files form being backuped.\n"+
|
||||||
"Be very careful when setting it, as it is easy to make your backuped world unusable!\n")
|
"Be very careful when setting it, as it is easy to make your backuped world unusable!\n")
|
||||||
public final Set<String> fileBlacklist = new HashSet<>();
|
public Set<String> fileBlacklist = new HashSet<>();
|
||||||
|
|
||||||
@Comment("\nShould every world has its won backup folder?\n")
|
@Comment("\nShould every world has its won backup folder?\n")
|
||||||
public final boolean perWorldBackup = false;
|
public boolean perWorldBackup = false;
|
||||||
|
|
||||||
@Comment("\nMaximum number of backups to keep. If 0 then no backup will be deleted based on its amount\n")
|
@Comment("\nMaximum number of backups to keep. If 0 then no backup will be deleted based on its amount\n")
|
||||||
public final int backupsToKeep = 10;
|
public int backupsToKeep = 10;
|
||||||
|
|
||||||
@Comment("\nMaximum age of backups to keep in seconds.\n if 0 then backups will not be deleted based on its age \n")
|
@Comment("\nMaximum age of backups to keep in seconds.\n if 0 then backups will not be deleted based on its age \n")
|
||||||
public final long maxAge = 0;
|
public long maxAge = 0;
|
||||||
|
|
||||||
@Comment("\nMaximum size of backup folder in kilo bytes. \n")
|
@Comment("\nMaximum size of backup folder in kilo bytes. \n")
|
||||||
public final int maxSize = 0;
|
public int maxSize = 0;
|
||||||
|
|
||||||
@Comment("\nCompression level \n0 - 9\n Only available for zip compression.\n")
|
@Comment("\nCompression level \n0 - 9\n Only available for zip compression.\n")
|
||||||
public final int compression = 1;
|
public int compression = 6;
|
||||||
|
|
||||||
@Comment(value = "\nAvailable formats are:\n" +
|
@Comment(value = "\nAvailable formats are:\n" +
|
||||||
"ZIP - normal zip archive using standard deflate compression\n" +
|
"ZIP - normal zip archive using standard deflate compression\n" +
|
||||||
"GIZP - tar.gz using gzip compression\n" +
|
"GIZP - tar.gz using gzip compression\n" +
|
||||||
"BZIP2 - tar.bz2 archive using bzip2 compression\n" +
|
"BZIP2 - tar.bz2 archive using bzip2 compression\n" +
|
||||||
"LZMA - tar.xz using lzma compression\n")
|
"LZMA - tar.xz using lzma compression\n")
|
||||||
public final ArchiveFormat format = ArchiveFormat.ZIP;
|
public ArchiveFormat format = ArchiveFormat.ZIP;
|
||||||
|
|
||||||
@Comment("\nPrint info to game out\n")
|
@Comment("\nPrint info to game out\n")
|
||||||
public final boolean log = true;
|
public boolean log = true;
|
||||||
|
|
||||||
@Comment("\nMinimal permission level required to run commands\n")
|
@Comment("\nMinimal permission level required to run commands\n")
|
||||||
public final int permissionLevel = 4;
|
public int permissionLevel = 4;
|
||||||
|
|
||||||
@Comment("\nPlayer on singleplayer is always allowed to run command. Warning! On lan party everyone will be allowed to run it.\n")
|
@Comment("\nPlayer on singleplayer is always allowed to run command. Warning! On lan party everyone will be allowed to run it.\n")
|
||||||
public final boolean alwaysSingleplayerAllowed = true;
|
public boolean alwaysSingleplayerAllowed = true;
|
||||||
|
|
||||||
@Comment("\nPlayers allowed to run backup commands without sufficient permission level\n")
|
@Comment("\nPlayers allowed to run backup commands without sufficient permission level\n")
|
||||||
public final Set<String> playerWhitelist = new HashSet<>();
|
public Set<String> playerWhitelist = new HashSet<>();
|
||||||
|
|
||||||
@Comment("\nPlayers banned from running backup commands besides their sufficient permission level\n")
|
@Comment("\nPlayers banned from running backup commands besides their sufficient permission level\n")
|
||||||
public final Set<String> playerBlacklist = new HashSet<>();
|
public Set<String> playerBlacklist = new HashSet<>();
|
||||||
|
|
||||||
@Comment("\nFormat of date&time used to name backup files.\n")
|
@Comment("\nFormat of date&time used to name backup files.\n")
|
||||||
public final String dateTimeFormat = "dd.MM.yyyy_HH-mm-ss";
|
public String dateTimeFormat = "dd.MM.yyyy_HH-mm-ss";
|
||||||
|
|
||||||
public enum ArchiveFormat {
|
public enum ArchiveFormat {
|
||||||
ZIP(".zip"),
|
ZIP(".zip"),
|
||||||
|
|
|
@ -72,7 +72,6 @@ public class ParallelZipCompressor {
|
||||||
|
|
||||||
public InputStream get() {
|
public InputStream get() {
|
||||||
try {
|
try {
|
||||||
System.out.println("Creating: " + sourceFile);
|
|
||||||
stream = Files.newInputStream(sourceFile);
|
stream = Files.newInputStream(sourceFile);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
Loading…
Reference in New Issue