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
I have a Brigadier command that has similar functionality to /execute, i.e. to conditionally run commands based on plugin data. Since I moved from using lucko's commodore to using the Lifecycle API to register Brigadier commands, my /execute clone is not able to register anymore when it contains a redirection to the root command node:
[LifecycleEventRunner] Could not run 'commands' lifecycle event handler from PandacubePaper vdev
java.lang.IllegalArgumentException: Unknown command node passed. Don't know how to unwrap this.
at io.papermc.paper.command.brigadier.ApiMirrorRootNode.convertFromPureBrigNode(ApiMirrorRootNode.java:144)~
at io.papermc.paper.command.brigadier.ApiMirrorRootNode.unwrapNode(ApiMirrorRootNode.java:93)~
at io.papermc.paper.command.brigadier.ApiMirrorRootNode.simpleUnwrap(ApiMirrorRootNode.java:249)~
at io.papermc.paper.command.brigadier.ApiMirrorRootNode.convertFromPureBrigNode(ApiMirrorRootNode.java:106)~
at io.papermc.paper.command.brigadier.ApiMirrorRootNode.unwrapNode(ApiMirrorRootNode.java:93)~
at io.papermc.paper.command.brigadier.ApiMirrorRootNode.convertFromPureBrigNode(ApiMirrorRootNode.java:155)~
at io.papermc.paper.command.brigadier.ApiMirrorRootNode.unwrapNode(ApiMirrorRootNode.java:93)~
at io.papermc.paper.command.brigadier.ApiMirrorRootNode.addChild(ApiMirrorRootNode.java:205)~
at io.papermc.paper.command.brigadier.PaperCommands.registerIntoDispatcher(PaperCommands.java:156)~
at io.papermc.paper.command.brigadier.PaperCommands.registerWithFlags(PaperCommands.java:102)~
at io.papermc.paper.command.brigadier.PaperCommands.register(PaperCommands.java:90)~
at io.papermc.paper.command.brigadier.PaperCommands.register(PaperCommands.java:85)~
at PandacubePaper-1668.jar/fr.pandacube.lib.paper.commands.PaperBrigadierCommand.lambda$register$6(PaperBrigadierCommand.java:169)~
at io.papermc.paper.plugin.lifecycle.event.LifecycleEventRunner.lambda$callEvent$2(LifecycleEventRunner.java:68)~
at io.papermc.paper.plugin.lifecycle.event.types.PrioritizableLifecycleEventType.forEachHandler(PrioritizableLifecycleEventType.java:53)~
at io.papermc.paper.plugin.lifecycle.event.LifecycleEventRunner.callEvent(LifecycleEventRunner.java:63)~
at io.papermc.paper.plugin.lifecycle.event.LifecycleEventRunner.callReloadableRegistrarEvent(LifecycleEventRunner.java:107)~
at NMS.MinecraftServer.loadWorld0(MinecraftServer.java:678)~
at NMS.MinecraftServer.loadLevel(MinecraftServer.java:437)~
at NMS.dedicated.DedicatedServer.initServer(DedicatedServer.java:323)~
at NMS.MinecraftServer.runServer(MinecraftServer.java:1136)~
at NMS.MinecraftServer.lambda$spin$0(MinecraftServer.java:323)~
at java.base/java.lang.Thread.run(Thread.java:1583)~
It seems like the node unwrapper does not support encountering the RootCommandNode instance in the tree, since it’s not a subclass for LiteralCommandNode or ArgumentCommandNode:
+ } else if (pureArgumentType instanceof final VanillaArgumentProviderImpl.NativeWrapperArgumentType<?,?> nativeWrapperArgumentType) {
+ converted = this.unwrapArgumentWrapper(pureArgumentNode, nativeWrapperArgumentType, nativeWrapperArgumentType, null); // "null" for suggestion provider so it uses the argument type's suggestion provider
+
+ /*
+ If it's not a wrapped type, it either has to be a primitive or an already
+ defined NMS type.
+ This method allows us to check if this is recognized by vanilla.
+ */
+ } else if (ArgumentTypeInfos.isClassRecognized(pureArgumentType.getClass())) {
+ // Allow any type of argument, as long as it's recognized by the client (but in most cases, this should be API only types)
+ // Previously we only allowed whitelisted types.
Is your feature request related to a problem?
I have a Brigadier command that has similar functionality to /execute, i.e. to conditionally run commands based on plugin data. Since I moved from using lucko's commodore to using the Lifecycle API to register Brigadier commands, my /execute clone is not able to register anymore when it contains a redirection to the root command node:
It seems like the node unwrapper does not support encountering the RootCommandNode instance in the tree, since it’s not a subclass for LiteralCommandNode or ArgumentCommandNode:
Paper/patches/server/0955-Brigadier-based-command-API.patch
Lines 355 to 405 in 817550c
Describe the solution you'd like.
Being able to do this :
Then run the following command in chat or command block:
/myexecute run tp @p 100 70 100
Describe alternatives you've considered.
Other
No response
The text was updated successfully, but these errors were encountered: