Fix tab completions not being forwarded to backend if proxy command exists but is inaccessible (#1329)
This commit is contained in:
@@ -347,8 +347,19 @@ public class VelocityCommandManager implements CommandManager {
|
||||
|
||||
@Override
|
||||
public boolean hasCommand(final String alias) {
|
||||
return getCommand(alias) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasCommand(String alias, CommandSource source) {
|
||||
Preconditions.checkNotNull(source, "source");
|
||||
CommandNode<CommandSource> command = getCommand(alias);
|
||||
return command != null && command.canUse(source);
|
||||
}
|
||||
|
||||
CommandNode<CommandSource> getCommand(final String alias) {
|
||||
Preconditions.checkNotNull(alias, "alias");
|
||||
return dispatcher.getRoot().getChild(alias.toLowerCase(Locale.ENGLISH)) != null;
|
||||
return dispatcher.getRoot().getChild(alias.toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
|
||||
@VisibleForTesting // this constitutes unsafe publication
|
||||
|
@@ -630,7 +630,7 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
|
||||
}
|
||||
|
||||
String commandLabel = command.substring(0, commandEndPosition);
|
||||
if (!server.getCommandManager().hasCommand(commandLabel)) {
|
||||
if (!server.getCommandManager().hasCommand(commandLabel, player)) {
|
||||
if (player.getProtocolVersion().lessThan(ProtocolVersion.MINECRAFT_1_13)) {
|
||||
// Outstanding tab completes are recorded for use with 1.12 clients and below to provide
|
||||
// additional tab completion support.
|
||||
|
Reference in New Issue
Block a user