-
Notifications
You must be signed in to change notification settings - Fork 396
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
Fix wrong redirect behavior (MC-256419) #124
Conversation
This bug is also reported at JIRA. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for this PR! 😊 Noticed a tiny issue, but should be a small change 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me, thanks again! 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me - thank you for also adding tests!
Seems that https://bugs.mojang.com/browse/MC-256419 and https://bugs.mojang.com/browse/MC-165773 can be closed as fixed. @slicedlime @Gegy |
Not quite - they will be closed when a Minecraft version is released using the updated library. |
Overview
Brigadier set the variable
foundCommand
to true HERE even if noCommand<S>
was executed, and this cause a serious problem.An example to this is in minecraft: if you execute the command
/xp query Steve
, you will not receive an error message from the server. This is because thatxp
is redirected fromexperience
, and when brigadier found this command is redirected, it setfoundCommand
to true--even if nothing is actually executed.Ways to fix
I think the best way is to remove this wrong assignment. I tried in fabric to modify this code like below, and it works.
The result after my modification was tested in Minecraft 1.19. With this modification,
/xp query Steve
will throw aCommandSyntaxException
as expected and an error message from the server was received.