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! --- .../java/com/keuin/kbackupfabric/KBCommands.java | 24 +++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/keuin/kbackupfabric/KBCommands.java') diff --git a/src/main/java/com/keuin/kbackupfabric/KBCommands.java b/src/main/java/com/keuin/kbackupfabric/KBCommands.java index dbe5252..f2671ad 100644 --- a/src/main/java/com/keuin/kbackupfabric/KBCommands.java +++ b/src/main/java/com/keuin/kbackupfabric/KBCommands.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.operation.AbstractConfirmableOperation; import com.keuin.kbackupfabric.util.BackupFilesystemUtil; import com.keuin.kbackupfabric.util.BackupNameTimeFormatter; @@ -48,6 +49,27 @@ public final class KBCommands { return SUCCESS; } + /** + * Print the help menu. (May show extra info during the first run after restoring) + * + * @param context the context. + * @return stat code. + */ + public static int kb(CommandContext context) { + int statCode = list(context); + if (MetadataHolder.hasMetadata()) { + // Output metadata info + msgStress(context, "Restored from backup " + MetadataHolder.getMetadata().getBackupName()); + } + return statCode; + } + + /** + * List all existing backups. + * + * @param context the context. + * @return stat code. + */ public static int list(CommandContext context) { msgInfo(context, "Available backups: (file is not checked, manipulation may affect this plugin)"); MinecraftServer server = context.getSource().getMinecraftServer(); -- cgit v1.2.3