-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow asynchronous commands #6
Comments
Does Mojang/brigadier allow commands to be executed asynchronously? |
Asynchronous commands aren't supported in the Java library, but Java does not have promise or |
I'm unsure whether this would be possible, I still want to support synchronous command execution as there are cases where async execution is unpreferable. When Kind of similar to Mojang/brigadier#62 I realize, maybe I can take this as inspiration |
Although such an approach wouldn't be entirely backwards compatible, I think the Alternatively, your approach could work, but would require a fair bit of refactoring to pass the type parameter down from the command source to nodes. I hope asynchronous commands become possible in the future no matter what approach is taken, because promises unlock to ability to do particularly neat things that aren't easily possible synchronously. |
Currently, the return type of
CommandDispatcher#execute
is anumber
, as theCommand
type requires anumber | void
return type. As a result, commands cannot be executed asynchronously.The text was updated successfully, but these errors were encountered: