Skip to content
This repository has been archived by the owner on Feb 28, 2021. It is now read-only.

Tab complete does not honor requires() #16

Open
unascribed opened this issue Oct 25, 2020 · 4 comments
Open

Tab complete does not honor requires() #16

unascribed opened this issue Oct 25, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@unascribed
Copy link

Registering a client command that has a requires() check does not remove it from tab complete like it does on the server.

Accepting the completion shows an immediate syntax error and highlights the command in red, so the requirement is recognized, but the tab complete isn't honoring it.

Minecraft 1.16.3, Fabric Loader v0.10.0+build.208, Fabric API 0.22.0+build.408-1.16

Workaround: Just don't register the command. Works in my case as my requires() check was "integrated server is absent", but more complex checks don't have that luxury.

@unascribed unascribed added the bug Something isn't working label Oct 25, 2020
@i509VCB
Copy link

i509VCB commented Oct 26, 2020

So this is the result of a fundamental difference between commands originating on the server and client act. A command registered on the server will go through the requires check and will be omitted from the command tree the client receives if a player cannot access the command.

Likewise the command dispatcher on the client has no filtering of these "inaccessible" nodes, so some internal logic changes would be required to handle that.

@unascribed
Copy link
Author

I see; still getting used to Brigadier.

If this is complicated to implement it's probably not worth bothering. Just noticed the discrepancy between server and client command behavior.

@i509VCB
Copy link

i509VCB commented Oct 26, 2020

Juuz has been working on integrating this into fabric api, so fixing this is going to be essential.

@Juuxel
Copy link
Member

Juuxel commented Oct 30, 2020

I did this for the Fabric API PR (FabricMC/fabric#1115), but it'd need quite a lot of modification to fit CCC so I'm not most likely going to port them here. (If it doesn't get merged, I'll probably reuse the FabLabs API as a new major version of CCC.)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants