diff --git a/leaves-server/src/main/java/org/leavesmc/leaves/command/arguments/BotArgumentType.java b/leaves-server/src/main/java/org/leavesmc/leaves/command/arguments/BotArgumentType.java index dff8c5ea..f4518812 100644 --- a/leaves-server/src/main/java/org/leavesmc/leaves/command/arguments/BotArgumentType.java +++ b/leaves-server/src/main/java/org/leavesmc/leaves/command/arguments/BotArgumentType.java @@ -16,6 +16,13 @@ import java.util.concurrent.CompletableFuture; public class BotArgumentType implements CustomArgumentType.Converted<@NotNull ServerBot, @NotNull String> { + private BotArgumentType() { + } + + public static @NotNull BotArgumentType bot() { + return new BotArgumentType(); + } + @Override public @NotNull CompletableFuture listSuggestions(com.mojang.brigadier.context.@NotNull CommandContext context, @NotNull SuggestionsBuilder builder) { Collection bots = BotList.INSTANCE.bots; diff --git a/leaves-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/ActionCommand.java b/leaves-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/ActionCommand.java index af2c3afd..d0736996 100644 --- a/leaves-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/ActionCommand.java +++ b/leaves-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/ActionCommand.java @@ -27,7 +27,7 @@ public class ActionCommand extends BotSubcommand { public static class BotArgument extends ArgumentNode { private BotArgument() { - super("bot", new BotArgumentType()); + super("bot", BotArgumentType.bot()); children( StartCommand::new, StopCommand::new, diff --git a/leaves-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/ConfigCommand.java b/leaves-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/ConfigCommand.java index 779b2b50..98fb98c4 100644 --- a/leaves-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/ConfigCommand.java +++ b/leaves-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/ConfigCommand.java @@ -42,7 +42,7 @@ public class ConfigCommand extends BotSubcommand { private static class BotArgument extends ArgumentNode { private BotArgument() { - super("bot", new BotArgumentType()); + super("bot", BotArgumentType.bot()); Configs.getConfigs().stream().map(this::configNodeCreator).forEach(this::children); } diff --git a/leaves-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/RemoveCommand.java b/leaves-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/RemoveCommand.java index 01225a57..67f75ad5 100644 --- a/leaves-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/RemoveCommand.java +++ b/leaves-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/RemoveCommand.java @@ -43,7 +43,7 @@ public class RemoveCommand extends BotSubcommand { private static class BotArgument extends ArgumentNode { private BotArgument() { - super("bot", new BotArgumentType()); + super("bot", BotArgumentType.bot()); children(RemoveTimeArgument::new); } diff --git a/leaves-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/SaveCommand.java b/leaves-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/SaveCommand.java index 2d243cb5..f0dac9af 100644 --- a/leaves-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/SaveCommand.java +++ b/leaves-server/src/main/java/org/leavesmc/leaves/command/bot/subcommands/SaveCommand.java @@ -33,7 +33,7 @@ public class SaveCommand extends BotSubcommand { private static class BotArgument extends ArgumentNode { private BotArgument() { - super("bot", new BotArgumentType()); + super("bot", BotArgumentType.bot()); } @Override