From e3a95b478347996f72852bfa0abbf18a34bc1c56 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Thu, 30 Jul 2020 06:06:37 -0400 Subject: [PATCH] Actually fix accidental breaking change not allowing aliases to be overridden. --- .../proxy/command/VelocityCommandManager.java | 5 +++++ 1 file changed, 5 insertions(+) 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 99c882aa5..072c45634 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/command/VelocityCommandManager.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/command/VelocityCommandManager.java @@ -112,6 +112,11 @@ public class VelocityCommandManager implements CommandManager { dispatcher.getRoot().addChild(node); while (aliasIterator.hasNext()) { String otherAlias = aliasIterator.next(); + CommandNode existingNode = dispatcher.getRoot() + .getChild(alias.toLowerCase(Locale.ENGLISH)); + if (existingNode != null) { + dispatcher.getRoot().getChildren().remove(existingNode); + } dispatcher.getRoot().addChild(BrigadierUtils.buildRedirect(otherAlias, node)); } }