summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/kbackupfabric/KBRegister.java
diff options
context:
space:
mode:
authorKeuin <[email protected]>2020-04-23 20:57:17 +0800
committerkeuin <[email protected]>2020-04-23 20:57:17 +0800
commitf7f918f19b5d0597d21f03b7085425c3a93cc5f6 (patch)
treeb23b3985d48651043bf4780090a777182a2ea76c /src/main/java/com/keuin/kbackupfabric/KBRegister.java
parentba19ab350516e26a8e52cc217878bde63c0b7eee (diff)
Added backup name completion.
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/KBRegister.java')
-rw-r--r--src/main/java/com/keuin/kbackupfabric/KBRegister.java32
1 files changed, 0 insertions, 32 deletions
diff --git a/src/main/java/com/keuin/kbackupfabric/KBRegister.java b/src/main/java/com/keuin/kbackupfabric/KBRegister.java
deleted file mode 100644
index 11f05a1..0000000
--- a/src/main/java/com/keuin/kbackupfabric/KBRegister.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package com.keuin.kbackupfabric;
-
-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 KBRegister {
- // First make method to register
- public static void registerCommands(CommandDispatcher<ServerCommandSource> dispatcher) {
- // register /kb and /kb help for help menu
- dispatcher.register(CommandManager.literal("kb").executes(KBCommands::help));
- 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.string()).requires(PermissionValidator::op).executes(KBCommands::backup)).requires(PermissionValidator::op).executes(KBCommands::backupWithDefaultName)));
-
- // register /kb restore <name> for performing restore. OP is required.
- dispatcher.register(CommandManager.literal("kb").then(CommandManager.literal("restore").then(CommandManager.argument("backupName", StringArgumentType.string()).requires(PermissionValidator::op).executes(KBCommands::restore)).executes(KBCommands::list)));
-
- // 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)));
-
- }
-}