Tab completer improvements (#80)

* Attempt to improve the tab completion for Plex

* i give up for the night

* steven is a god

* Fix permission node
This commit is contained in:
2024-01-20 11:32:24 -06:00
committed by GitHub
parent c9d954d1c0
commit 72467de5ce
39 changed files with 255 additions and 128 deletions

View File

@ -9,7 +9,6 @@ import dev.plex.command.exception.PlayerNotBannedException;
import dev.plex.command.exception.PlayerNotFoundException;
import dev.plex.command.source.RequiredCommandSource;
import dev.plex.player.PlexPlayer;
import dev.plex.util.PlexUtils;
import net.kyori.adventure.text.Component;
import org.bukkit.command.CommandSender;
@ -56,8 +55,8 @@ public class UnbanCMD extends PlexCommand
}
@Override
public @NotNull List<String> tabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
public @NotNull List<String> smartTabComplete(@NotNull CommandSender sender, @NotNull String alias, @NotNull String[] args) throws IllegalArgumentException
{
return args.length == 1 && silentCheckPermission(sender,"plex.unban") ? PlexUtils.getPlayerNameList() : ImmutableList.of();
return args.length == 1 && silentCheckPermission(sender, this.getPermission()) ? PlexUtils.getPlayerNameList() : ImmutableList.of();
}
}