diff --git a/src/main/java/net/szum123321/textile_backup/TextileBackup.java b/src/main/java/net/szum123321/textile_backup/TextileBackup.java index 123ea11..ff10cea 100644 --- a/src/main/java/net/szum123321/textile_backup/TextileBackup.java +++ b/src/main/java/net/szum123321/textile_backup/TextileBackup.java @@ -44,7 +44,7 @@ public class TextileBackup implements ModInitializer { public static ConfigHandler config; public static final BackupScheduler scheduler = new BackupScheduler(); - public static final ExecutorService executorSerivece = Executors.newSingleThreadExecutor(); + public static final ExecutorService executorService = Executors.newSingleThreadExecutor(); @Override public void onInitialize() { diff --git a/src/main/java/net/szum123321/textile_backup/commands/StartBackupCommand.java b/src/main/java/net/szum123321/textile_backup/commands/StartBackupCommand.java index 571b46d..ed205e5 100644 --- a/src/main/java/net/szum123321/textile_backup/commands/StartBackupCommand.java +++ b/src/main/java/net/szum123321/textile_backup/commands/StartBackupCommand.java @@ -35,7 +35,7 @@ public class StartBackupCommand { } private static int executeWithComment(CommandContext source) { - TextileBackup.executorSerivece.submit( + TextileBackup.executorService.submit( BackupHelper.create( source.getSource().getMinecraftServer(), source.getSource(), @@ -48,7 +48,7 @@ public class StartBackupCommand { } private static int execute(ServerCommandSource source){ - TextileBackup.executorSerivece.submit( + TextileBackup.executorService.submit( BackupHelper.create( source.getMinecraftServer(), source, diff --git a/src/main/java/net/szum123321/textile_backup/core/BackupScheduler.java b/src/main/java/net/szum123321/textile_backup/core/BackupScheduler.java index 46da9eb..a0703aa 100644 --- a/src/main/java/net/szum123321/textile_backup/core/BackupScheduler.java +++ b/src/main/java/net/szum123321/textile_backup/core/BackupScheduler.java @@ -22,8 +22,8 @@ public class BackupScheduler { if(TextileBackup.config.doBackupsOnEmptyServer || server.getPlayerManager().getCurrentPlayerCount() > 0) { if(scheduled) { - if(nextBackup >= now) { - TextileBackup.executorSerivece.submit(BackupHelper.create(server, null, true, null)); + if(nextBackup <= now) { + TextileBackup.executorService.submit(BackupHelper.create(server, null, true, null)); nextBackup = now + TextileBackup.config.backupInterval; } @@ -32,8 +32,8 @@ public class BackupScheduler { scheduled = true; } } else if(!TextileBackup.config.doBackupsOnEmptyServer && server.getPlayerManager().getCurrentPlayerCount() == 0) { - if(scheduled && nextBackup >= now) { - TextileBackup.executorSerivece.submit(BackupHelper.create(server, null, true, null)); + if(scheduled && nextBackup <= now) { + TextileBackup.executorService.submit(BackupHelper.create(server, null, true, null)); scheduled = false; }