summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java
diff options
context:
space:
mode:
authorKeuin <[email protected]>2024-01-20 13:20:41 +0800
committerKeuin <[email protected]>2024-01-20 13:51:41 +0800
commit7e3cd92742383c43f2741449c551208e6487154e (patch)
treef6a4a51d0164231ac0fd2faed8f313aa504e2504 /src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java
parent61aa66b558ae8f2987a238216ac01e375f195c1e (diff)
feature: configurable CoW incremental backup
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java')
-rw-r--r--src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java11
1 files changed, 10 insertions, 1 deletions
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)));