From 91dd3b5470e561de2e093d957dae99d8dd6e06f6 Mon Sep 17 00:00:00 2001 From: William Date: Tue, 23 Aug 2022 17:27:10 +0100 Subject: [PATCH] Fix TAB completion for console --- .../net/william278/huskhomes/command/BukkitCommand.java | 2 +- .../net/william278/huskhomes/command/TabCompletable.java | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/bukkit/src/main/java/net/william278/huskhomes/command/BukkitCommand.java b/bukkit/src/main/java/net/william278/huskhomes/command/BukkitCommand.java index a4ce2fb2..e6fd23b0 100644 --- a/bukkit/src/main/java/net/william278/huskhomes/command/BukkitCommand.java +++ b/bukkit/src/main/java/net/william278/huskhomes/command/BukkitCommand.java @@ -67,7 +67,7 @@ public class BukkitCommand implements CommandExecutor, TabExecutor { public List onTabComplete(@NotNull CommandSender sender, @NotNull Command command, @NotNull String alias, @NotNull String[] args) { if (this.command instanceof TabCompletable tabCompletable) { - return tabCompletable.onTabComplete(BukkitPlayer.adapt((Player) sender), args); + return tabCompletable.onTabComplete(args); } return Collections.emptyList(); } diff --git a/common/src/main/java/net/william278/huskhomes/command/TabCompletable.java b/common/src/main/java/net/william278/huskhomes/command/TabCompletable.java index 798392f4..abf5fbea 100644 --- a/common/src/main/java/net/william278/huskhomes/command/TabCompletable.java +++ b/common/src/main/java/net/william278/huskhomes/command/TabCompletable.java @@ -1,6 +1,5 @@ package net.william278.huskhomes.command; -import net.william278.huskhomes.player.OnlineUser; import org.jetbrains.annotations.NotNull; import java.util.List; @@ -13,11 +12,10 @@ public interface TabCompletable { /** * What should be returned when the player attempts to TAB-complete the command * - * @param onlineUser {@link OnlineUser} doing the TAB completion - * @param args Current command arguments + * @param args Current command arguments * @return List of String arguments to offer TAB suggestions */ @NotNull - List onTabComplete(@NotNull OnlineUser onlineUser, @NotNull String[] args); + List onTabComplete(@NotNull String[] args); }