From c18ce123c0bbdfc232fb8b712832ba2f1b7ed92b Mon Sep 17 00:00:00 2001 From: Daniel Walsh Date: Sat, 9 Oct 2021 18:02:22 +0100 Subject: [PATCH] Add "disable" to tab complete --- .../slimefun4/core/commands/SlimefunTabCompleter.java | 3 +++ .../slimefun4/core/commands/subcommands/DebugCommand.java | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/SlimefunTabCompleter.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/SlimefunTabCompleter.java index 07ca70bf0..f81f83366 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/SlimefunTabCompleter.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/SlimefunTabCompleter.java @@ -10,6 +10,7 @@ import java.util.Locale; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import io.github.thebusybiscuit.slimefun4.core.commands.subcommands.DebugCommand; import org.bukkit.command.Command; import org.bukkit.command.CommandSender; import org.bukkit.command.TabCompleter; @@ -33,6 +34,8 @@ class SlimefunTabCompleter implements TabCompleter { public List onTabComplete(CommandSender sender, Command cmd, String label, String[] args) { if (args.length == 1) { return createReturnList(command.getSubCommandNames(), args[0]); + } else if (args.length == 2) { + return createReturnList(DebugCommand.tabCompletions, args[1]); } else if (args.length == 3) { if (args[0].equalsIgnoreCase("give")) { return createReturnList(getSlimefunItems(), args[2]); diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/DebugCommand.java b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/DebugCommand.java index 56d38f34c..1ee83ba27 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/DebugCommand.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/core/commands/subcommands/DebugCommand.java @@ -7,6 +7,8 @@ import io.github.thebusybiscuit.slimefun4.implementation.Slimefun; import org.bukkit.command.CommandSender; import javax.annotation.Nonnull; +import java.util.Collections; +import java.util.List; /** * The debug command will allow server owners to get information for us developers. @@ -16,6 +18,8 @@ import javax.annotation.Nonnull; */ public class DebugCommand extends SubCommand { + public static final List tabCompletions = Collections.singletonList("disable"); + protected DebugCommand(@Nonnull Slimefun plugin, @Nonnull SlimefunCommand cmd) { super(plugin, cmd, "debug", true); }