From 61ade9adad4668494dfc32da7751e1b86251dc97 Mon Sep 17 00:00:00 2001 From: Keuin Date: Mon, 30 Nov 2020 13:15:15 +0800 Subject: Implementing incremental backup --- .../com/keuin/kbackupfabric/KBCommandRegister.java | 39 ---------------------- 1 file changed, 39 deletions(-) delete mode 100644 src/main/java/com/keuin/kbackupfabric/KBCommandRegister.java (limited to 'src/main/java/com/keuin/kbackupfabric/KBCommandRegister.java') diff --git a/src/main/java/com/keuin/kbackupfabric/KBCommandRegister.java b/src/main/java/com/keuin/kbackupfabric/KBCommandRegister.java deleted file mode 100644 index bfbe3c1..0000000 --- a/src/main/java/com/keuin/kbackupfabric/KBCommandRegister.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.keuin.kbackupfabric; - -import com.keuin.kbackupfabric.util.backup.BackupNameSuggestionProvider; -import com.keuin.kbackupfabric.util.PermissionValidator; -import com.mojang.brigadier.CommandDispatcher; -import com.mojang.brigadier.arguments.StringArgumentType; -import net.minecraft.server.command.CommandManager; -import net.minecraft.server.command.ServerCommandSource; - -public final class KBCommandRegister { - // First make method to register - public static void registerCommands(CommandDispatcher dispatcher) { - - // register /kb and /kb help for help menu - dispatcher.register(CommandManager.literal("kb").executes(KBCommands::kb)); - dispatcher.register(CommandManager.literal("kb").then(CommandManager.literal("help").executes(KBCommands::help))); - - // register /kb list for showing the backup list. OP is required. - dispatcher.register(CommandManager.literal("kb").then(CommandManager.literal("list").requires(PermissionValidator::op).executes(KBCommands::list))); - - // register /kb backup [name] for performing backup. OP is required. - dispatcher.register(CommandManager.literal("kb").then(CommandManager.literal("backup").then(CommandManager.argument("backupName", StringArgumentType.greedyString()).requires(PermissionValidator::op).executes(KBCommands::backup)).requires(PermissionValidator::op).executes(KBCommands::backupWithDefaultName))); - - // register /kb restore for performing restore. OP is required. - dispatcher.register(CommandManager.literal("kb").then(CommandManager.literal("restore").then(CommandManager.argument("backupName", StringArgumentType.greedyString()).suggests(BackupNameSuggestionProvider.getProvider()).requires(PermissionValidator::op).executes(KBCommands::restore)).executes(KBCommands::list))); - - // register /kb delete [name] for deleting an existing backup. OP is required. - dispatcher.register(CommandManager.literal("kb").then(CommandManager.literal("delete").then(CommandManager.argument("backupName", StringArgumentType.greedyString()).suggests(BackupNameSuggestionProvider.getProvider()).requires(PermissionValidator::op).executes(KBCommands::delete)))); - - // register /kb confirm for confirming the execution. OP is required. - dispatcher.register(CommandManager.literal("kb").then(CommandManager.literal("confirm").requires(PermissionValidator::op).executes(KBCommands::confirm))); - - // register /kb cancel for cancelling the execution to be confirmed. OP is required. - dispatcher.register(CommandManager.literal("kb").then(CommandManager.literal("cancel").requires(PermissionValidator::op).executes(KBCommands::cancel))); - - // register /kb prev for showing the latest backup. - dispatcher.register(CommandManager.literal("kb").then(CommandManager.literal("prev").requires(PermissionValidator::op).executes(KBCommands::prev))); - } -} -- cgit v1.2.3