From 7e3cd92742383c43f2741449c551208e6487154e Mon Sep 17 00:00:00 2001 From: Keuin Date: Sat, 20 Jan 2024 13:20:41 +0800 Subject: feature: configurable CoW incremental backup --- src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java') diff --git a/src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java b/src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java index 362abb8..20e9058 100644 --- a/src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java +++ b/src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java @@ -2,6 +2,7 @@ package com.keuin.kbackupfabric; import com.keuin.kbackupfabric.backup.BackupFilesystemUtil; import com.keuin.kbackupfabric.backup.suggestion.BackupNameSuggestionProvider; +import com.keuin.kbackupfabric.config.KBackupConfig; import com.keuin.kbackupfabric.event.OnPlayerConnect; import com.keuin.kbackupfabric.metadata.BackupMetadata; import com.keuin.kbackupfabric.metadata.MetadataHolder; @@ -32,7 +33,15 @@ public final class KBPluginEvents implements ModInitializer { @Override public void onInitialize() { - System.out.println("Binding events and commands ..."); + PrintUtil.info("Reading config..."); + try { + KBackupConfig.load(); + } catch (IOException e) { + PrintUtil.error("Failed to read config file, using default values: " + e + e.getMessage()); + } + boolean incCow = KBackupConfig.getInstance().getIncbakCow(); + PrintUtil.info("Incremental backup CoW: " + (incCow ? "enabled" : "disabled")); + PrintUtil.info("Binding events and commands..."); CommandRegistrationCallback.EVENT.register(KBCommandsRegister::registerCommands); OnPlayerConnect.ON_PLAYER_CONNECT.register((connection, player) -> NotificationManager.INSTANCE.notifyPlayer(DistinctNotifiable.fromServerPlayerEntity(player))); -- cgit v1.2.3