summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java')
-rw-r--r--src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java b/src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java
index 362abb8..8b55d1e 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;
@@ -29,10 +30,17 @@ import static org.apache.commons.io.FileUtils.forceDelete;
public final class KBPluginEvents implements ModInitializer {
//private static final Logger LOGGER = LogManager.getLogger();
-
@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)));