You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, the resulting Brigadier command tree looks like this:
literal "reputation"
offline player "player"
literal "good"
Other
I might be wrong, but I think this happens because o.i.c.brigadier.node.LiteralBrigadierNodeFactory#constructCommandNode(CommandNode<C>, BrigadierPermissionChecker<C>, com.mojang.brigadier.Command<S>) creates a literal node for the component name only, ignoring its aliases:
And then in LiteralBrigadierNodeFactory#createLiteralArgumentBuilder(CommandComponent<C>, CommandNode<C>, BrigadierPermissionChecker<C>):
private@NonNullArgumentBuilder<S, ?> createLiteralArgumentBuilder(
final@NonNullCommandComponent<C> component,
final@NonNullCommandNode<C> root,
final@NonNullBrigadierPermissionChecker<C> permissionChecker
) {
returnLiteralArgumentBuilder.<S>literal(component.name()) // <--- aliases not used
.requires(this.requirement(root, permissionChecker));
}
One possible fix would be making constructCommandNode(...) return a list of ArgumentBuilders which would work well with Brigadier node's then(...) method
But I might be completely wrong about why this happens, so ¯\_(ツ)_/¯
Steps to reproduce
Here's an example command:
Expected behavior
Expected command tree:
Observed behavior
However, the resulting Brigadier command tree looks like this:
Other
I might be wrong, but I think this happens because
o.i.c.brigadier.node.LiteralBrigadierNodeFactory#constructCommandNode(CommandNode<C>, BrigadierPermissionChecker<C>, com.mojang.brigadier.Command<S>)
creates a literal node for the component name only, ignoring its aliases:And then in
LiteralBrigadierNodeFactory#createLiteralArgumentBuilder(CommandComponent<C>, CommandNode<C>, BrigadierPermissionChecker<C>)
:One possible fix would be making
constructCommandNode(...)
return a list ofArgumentBuilder
s which would work well with Brigadier node'sthen(...)
methodBut I might be completely wrong about why this happens, so ¯\_(ツ)_/¯
It could also be related to #5
The text was updated successfully, but these errors were encountered: