summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/kbackupfabric/KBCommands.java
diff options
context:
space:
mode:
authorKeuin <[email protected]>2020-04-24 13:43:20 +0800
committerkeuin <[email protected]>2020-04-24 13:43:20 +0800
commitea01faf3947814fe7ecaa3705e5fbf0f171f7e48 (patch)
tree1cb406b0d0897da70414aa5f96e8b1dd1eac40fb /src/main/java/com/keuin/kbackupfabric/KBCommands.java
parent59674ed29c6b2c7e8ac98fc4f0f4fd4fd6d437c9 (diff)
Added hint at the "/kb" output in the first run after restoring from a backup.1.3.0-dev
Warning: Backup in this version is not compatible with older version!
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/KBCommands.java')
-rw-r--r--src/main/java/com/keuin/kbackupfabric/KBCommands.java24
1 files changed, 23 insertions, 1 deletions
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<ServerCommandSource> 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<ServerCommandSource> context) {
msgInfo(context, "Available backups: (file is not checked, manipulation may affect this plugin)");
MinecraftServer server = context.getSource().getMinecraftServer();