mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-25 22:10:21 +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) {
|
if (redirectTo.getChildren().isEmpty() || hasFlattenRedirectFlag) {
|
||||||
redirect = Commands.literal(aliasLiteral)
|
redirect = Commands.literal(aliasLiteral)
|
||||||
.executes(redirectTo.getCommand())
|
.executes(redirectTo.getCommand())
|
||||||
|
.forward(redirectTo.getRedirect(), redirectTo.getRedirectModifier(), redirectTo.isFork())
|
||||||
.requires(redirectTo.getRequirement())
|
.requires(redirectTo.getRequirement())
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue