Fix tab completions not being forwarded to backend if proxy command exists but is inaccessible (#1329)

This commit is contained in:
Gero
2024-05-26 14:19:37 +02:00
committed by GitHub
parent 71bb0246a8
commit 42d4288334
3 changed files with 25 additions and 2 deletions

View File

@@ -10,6 +10,7 @@ package com.velocitypowered.api.command;
import com.velocitypowered.api.event.command.CommandExecuteEvent;
import java.util.Collection;
import java.util.concurrent.CompletableFuture;
import java.util.function.Predicate;
import org.checkerframework.checker.nullness.qual.Nullable;
/**
@@ -126,4 +127,15 @@ public interface CommandManager {
* @return true if the alias is registered; false otherwise
*/
boolean hasCommand(String alias);
/**
* Returns whether the given alias is registered on this manager
* and can be used by the given {@link CommandSource}.
* See {@link com.mojang.brigadier.builder.ArgumentBuilder#requires(Predicate)}
*
* @param alias the command alias to check
* @param source the command source
* @return true if the alias is registered and usable; false otherwise
*/
boolean hasCommand(String alias, CommandSource source);
}