Small optimisation

2.x-1.16
szymon 2020-07-14 21:37:28 +02:00
parent 5dd25ce192
commit 944713beb5
2 changed files with 2 additions and 4 deletions

View File

@ -57,7 +57,8 @@ public class TextileBackup implements ModInitializer {
System.exit(1);
}
ServerTickEvents.END_SERVER_TICK.register(scheduler::tick);
if(TextileBackup.config.backupInterval > 0)
ServerTickEvents.END_SERVER_TICK.register(scheduler::tick);
CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> dispatcher.register(
LiteralArgumentBuilder.<ServerCommandSource>literal("backup")

View File

@ -15,9 +15,6 @@ public class BackupScheduler {
}
public void tick(MinecraftServer server) {
if(TextileBackup.config.backupInterval <= 0)
return;
long now = Instant.now().getEpochSecond();
if(TextileBackup.config.doBackupsOnEmptyServer || server.getPlayerManager().getCurrentPlayerCount() > 0) {