mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-25 14:00:15 +01:00
Copy forward when registering alias (fixes #10827)
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.
This commit is contained in:
parent
aa2c52baac
commit
1b3f9daf7c
1 changed files with 1 additions and 0 deletions
|
@ -132,6 +132,7 @@ public class PaperCommands implements Commands, PaperRegistrar<LifecycleEventOwn
|
|||
if (redirectTo.getChildren().isEmpty() || hasFlattenRedirectFlag) {
|
||||
redirect = Commands.literal(aliasLiteral)
|
||||
.executes(redirectTo.getCommand())
|
||||
.forward(redirectTo.getRedirect(), redirectTo.getRedirectModifier(), redirectTo.isFork())
|
||||
.requires(redirectTo.getRequirement())
|
||||
.build();
|
||||
|
||||
|
|
Loading…
Reference in a new issue