1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Add "disable" to tab complete

This commit is contained in:
Daniel Walsh 2021-10-09 18:02:22 +01:00
parent 4444fc6ec2
commit c18ce123c0
No known key found for this signature in database
GPG Key ID: DA4CCF44247893FD
2 changed files with 7 additions and 0 deletions

View File

@ -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<String> 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]);

View File

@ -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<String> tabCompletions = Collections.singletonList("disable");
protected DebugCommand(@Nonnull Slimefun plugin, @Nonnull SlimefunCommand cmd) {
super(plugin, cmd, "debug", true);
}