From 65e1b7be8732f544f3ea0a77d2f5767f9b1ef84f Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Wed, 29 Jul 2020 03:55:59 -0400 Subject: [PATCH] Hints will override the default catch-all by default --- .../proxy/command/VelocityCommandManager.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 368164e05..00473b29e 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/command/VelocityCommandManager.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/command/VelocityCommandManager.java @@ -101,8 +101,13 @@ public class VelocityCommandManager implements CommandManager { } if (!(command instanceof BrigadierCommand)) { - for (CommandNode hint : meta.getHints()) { - node.addChild(BrigadierUtils.wrapForHinting(hint, node.getCommand())); + if (!meta.getHints().isEmpty()) { + // If the user specified a hint, then allow the hint to take precedence over the catch-all + // argument. + node.getChildren().clear(); + for (CommandNode hint : meta.getHints()) { + node.addChild(BrigadierUtils.wrapForHinting(hint, node.getCommand())); + } } }