From ea01faf3947814fe7ecaa3705e5fbf0f171f7e48 Mon Sep 17 00:00:00 2001 From: Keuin Date: Fri, 24 Apr 2020 13:43:20 +0800 Subject: Added hint at the "/kb" output in the first run after restoring from a backup. Warning: Backup in this version is not compatible with older version! --- src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (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 1f39266..f3a3b07 100644 --- a/src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java +++ b/src/main/java/com/keuin/kbackupfabric/KBPluginEvents.java @@ -1,6 +1,7 @@ package com.keuin.kbackupfabric; -import com.keuin.kbackupfabric.data.BackupMetadata; +import com.keuin.kbackupfabric.metadata.BackupMetadata; +import com.keuin.kbackupfabric.metadata.MetadataHolder; import com.keuin.kbackupfabric.util.BackupFilesystemUtil; import com.keuin.kbackupfabric.util.BackupNameSuggestionProvider; import com.keuin.kbackupfabric.util.PrintUtil; @@ -46,7 +47,7 @@ public final class KBPluginEvents implements ModInitializer, ServerStartCallback File metadataFile = new File(levelDirectory, BackupMetadata.metadataFileName); if (metadataFile.exists()) { // Metadata exists. Deserialize. - BackupMetadata metadata = null; + BackupMetadata metadata; FileInputStream fileInputStream = new FileInputStream(metadataFile); ObjectInputStream in = new ObjectInputStream(fileInputStream); metadata = (BackupMetadata) in.readObject(); @@ -54,6 +55,7 @@ public final class KBPluginEvents implements ModInitializer, ServerStartCallback fileInputStream.close(); // Print metadata + MetadataHolder.setMetadata(metadata); PrintUtil.info("Recovered from previous backup:"); PrintUtil.info("Backup Name: " + metadata.getBackupName()); PrintUtil.info("Create Time: " + (new SimpleDateFormat("yyyy-MM-dd HH:mm:ss")).format(new Date(metadata.getBackupTime()))); -- cgit v1.2.3