diff --git a/platforms/spigot/src/main/java/net/codersky/mcutils/spigot/SpigotUtils.java b/platforms/spigot/src/main/java/net/codersky/mcutils/spigot/SpigotUtils.java index 7d624f4..92a8df3 100644 --- a/platforms/spigot/src/main/java/net/codersky/mcutils/spigot/SpigotUtils.java +++ b/platforms/spigot/src/main/java/net/codersky/mcutils/spigot/SpigotUtils.java @@ -247,9 +247,10 @@ public void registerCommands(SpigotCommand

... commands) { final List remaining = new ArrayList<>(); for (SpigotCommand

command : commands) { final PluginCommand plCommand = getPlugin().getCommand(command.getName()); - if (plCommand != null) + if (plCommand != null) { plCommand.setExecutor(command); - else + plCommand.setTabCompleter(command); + } else remaining.add(command); } if (remaining.isEmpty()) diff --git a/platforms/spigot/src/main/java/net/codersky/mcutils/spigot/cmd/SpigotCommand.java b/platforms/spigot/src/main/java/net/codersky/mcutils/spigot/cmd/SpigotCommand.java index 09411f7..2c9b313 100644 --- a/platforms/spigot/src/main/java/net/codersky/mcutils/spigot/cmd/SpigotCommand.java +++ b/platforms/spigot/src/main/java/net/codersky/mcutils/spigot/cmd/SpigotCommand.java @@ -14,6 +14,8 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import javax.annotation.Nonnull; + import java.util.Arrays; import java.util.List; @@ -63,9 +65,15 @@ public final boolean execute(@NotNull CommandSender sender, @NotNull String comm return subCommandHandler.onCommand(this, new SpigotCommandSender(sender, getUtils()), args); } + @NotNull @Override - @Nullable public final List onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) { + return tabComplete(sender, label, args); + } + + @NotNull + @Override + public final List tabComplete(@Nonnull CommandSender sender, @Nonnull String alias, @Nonnull String[] args) { return subCommandHandler.onTab(this, new SpigotCommandSender(sender, getUtils()), args); }