From b960c2b5104a04bc466a67783483014aabf78384 Mon Sep 17 00:00:00 2001 From: William Date: Mon, 17 Jun 2024 00:14:11 +0100 Subject: [PATCH] feat: register namespace-backed aliases on legacy paper --- .../net/william278/uniform/paper/LegacyPaperCommand.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/paper/src/main/java/net/william278/uniform/paper/LegacyPaperCommand.java b/paper/src/main/java/net/william278/uniform/paper/LegacyPaperCommand.java index d298f08..07e1387 100644 --- a/paper/src/main/java/net/william278/uniform/paper/LegacyPaperCommand.java +++ b/paper/src/main/java/net/william278/uniform/paper/LegacyPaperCommand.java @@ -85,11 +85,10 @@ public class LegacyPaperCommand extends BaseCommand aliases = Sets.newHashSet(command.getAliases()); - aliases.add("%s:%s".formatted( - plugin.getName().toLowerCase(Locale.ENGLISH).replaceAll("[^a-z0-9_]", ""), - command.getName()) - ); + command.getAliases().forEach(a -> aliases.add(namespace + ":" + a)); + aliases.add(namespace + ":" + command.getName()); aliases.forEach(alias -> event.getRoot().addChild( LiteralArgumentBuilder.literal(alias) .requires(built.getRequirement()).executes(built.getCommand()).redirect(built)