diff --git a/api/src/main/java/com/velocitypowered/api/command/CommandManager.java b/api/src/main/java/com/velocitypowered/api/command/CommandManager.java index b688adc63..68c3ed2c8 100644 --- a/api/src/main/java/com/velocitypowered/api/command/CommandManager.java +++ b/api/src/main/java/com/velocitypowered/api/command/CommandManager.java @@ -122,4 +122,12 @@ public interface CommandManager { * Can be completed exceptionally if an exception is thrown during execution. */ CompletableFuture executeImmediatelyAsync(CommandSource source, String cmdLine); + + /** + * Returns whether the given alias is registered on this manager. + * + * @param alias the command alias to check + * @return {@code true} if the alias is registered + */ + boolean hasCommand(String alias); } diff --git a/proxy/src/main/java/com/velocitypowered/proxy/command/VelocityCommandManager.java b/proxy/src/main/java/com/velocitypowered/proxy/command/VelocityCommandManager.java index cd5f034d7..b2d4e4f27 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/command/VelocityCommandManager.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/command/VelocityCommandManager.java @@ -227,6 +227,7 @@ public class VelocityCommandManager implements CommandManager { * @param alias the command alias to check * @return {@code true} if the alias is registered */ + @Override public boolean hasCommand(final String alias) { Preconditions.checkNotNull(alias, "alias"); return dispatcher.getRoot().getChild(alias.toLowerCase(Locale.ENGLISH)) != null;