Skip to content

Commit

Permalink
Copy forward when registering alias (fixes #10827)
Browse files Browse the repository at this point in the history
When flattening any command or registering an alias to a node with no direct children (such as a redirect), the code now takes into account any potential redirect/fork/forward on the target node. This fixes the issue where, when registering a command that was simply a redirect, only the namespaced literal would work, and not any aliases of the command.
  • Loading branch information
ookiegajwa committed Dec 23, 2024
1 parent aa2c52b commit 1b3f9da
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ private boolean registerRedirect(final String aliasLiteral, final PluginMeta plu
if (redirectTo.getChildren().isEmpty() || hasFlattenRedirectFlag) {
redirect = Commands.literal(aliasLiteral)
.executes(redirectTo.getCommand())
.forward(redirectTo.getRedirect(), redirectTo.getRedirectModifier(), redirectTo.isFork())
.requires(redirectTo.getRequirement())
.build();

Expand Down

0 comments on commit 1b3f9da

Please sign in to comment.